Skip to content

Commit

Permalink
Ensure device.registry.state.lock path exists before clearing it (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
rotemmiz authored Jun 10, 2018
1 parent b9a832f commit 730a4d6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions detox/local-cli/detox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const program = require('commander');
const path = require('path');
const cp = require('child_process');

const fs = require('fs-extra');
const _ = require('lodash');
const CustomError = require('../src/errors/CustomError');
const environment = require('../src/utils/environment');
Expand Down Expand Up @@ -167,8 +167,9 @@ function getPlatformSpecificString(platform) {


function clearDeviceRegistryLockFile() {
const fs = require('fs');
fs.writeFileSync(environment.getDeviceLockFilePath(), '[]');
const lockFilePath = environment.getDeviceLockFilePath();
fs.ensureFileSync(lockFilePath);
fs.writeFileSync(lockFilePath, '[]');
}

function getDefaultConfiguration() {
Expand Down

0 comments on commit 730a4d6

Please sign in to comment.