diff --git a/src/cli/index.js b/src/cli/index.js index a4b307d57a..d0c58f1c6b 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -291,7 +291,7 @@ export async function main({ const runEventuallyWithFile = (mutexFilename: ?string, isFirstTime?: boolean): Promise => { return new Promise(resolve => { const lockFilename = mutexFilename || path.join(config.cwd, constants.SINGLE_INSTANCE_FILENAME); - lockfile.lock(lockFilename, {realpath: false}, (err: mixed, release: () => void) => { + lockfile.lock(lockFilename, {realpath: false}, (err: mixed, release: (() => void) => void) => { if (err) { if (isFirstTime) { reporter.warn(reporter.lang('waitingInstance')); @@ -303,7 +303,7 @@ export async function main({ onDeath(() => { process.exitCode = 1; }); - resolve(run().then(release)); + resolve(run().then(() => new Promise(resolve => release(resolve)))); } }); });