diff --git a/package-lock.json b/package-lock.json index afb8e65..d89a1b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nexe", - "version": "3.0.4", + "version": "3.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 77a2ab0..d9d0e3e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nexe", "description": "Create a single executable out of your Node.js application", "license": "MIT", - "version": "3.0.4", + "version": "3.0.5", "contributors": [ "Craig Condon (http://crcn.io)", "Jared Allard ", diff --git a/src/steps/bundle.ts b/src/steps/bundle.ts index c0099ff..213382b 100644 --- a/src/steps/bundle.ts +++ b/src/steps/bundle.ts @@ -45,10 +45,11 @@ export default async function bundle(compiler: NexeCompiler, next: any) { if (input === STDIN_FLAG) { const maybeInput = resolveFileNameSync(cwd, '.') - if (!maybeInput) { + if (!maybeInput || !maybeInput.absPath) { throw new NexeError('No valid input detected') } input = maybeInput.absPath + compiler.entrypoint = './' + relative(cwd, input) } const { files, warnings } = await resolveFiles( diff --git a/src/steps/cli.ts b/src/steps/cli.ts index 17ed88e..69a62ed 100644 --- a/src/steps/cli.ts +++ b/src/steps/cli.ts @@ -1,4 +1,4 @@ -import { dirname, normalize, relative } from 'path' +import { dirname, normalize, relative, resolve } from 'path' import { createWriteStream, chmodSync, statSync } from 'fs' import { NexeCompiler } from '../compiler' import { NexeTarget } from '../target' @@ -24,18 +24,21 @@ export default async function cli(compiler: NexeCompiler, next: () => Promise { + return new Promise((res, rej) => { const step = log.step('Writing result to file') deliverable .pipe(createWriteStream(output)) - .on('error', reject) + .on('error', rej) .once('close', (e: Error) => { if (e) { - reject(e) + rej(e) } else if (compiler.output) { const output = compiler.output, mode = statSync(output).mode | 0o111, - inputFileLogOutput = relative(process.cwd(), compiler.options.input), + inputFileLogOutput = relative( + process.cwd(), + resolve(compiler.options.cwd, compiler.entrypoint || compiler.options.input) + ), outputFileLogOutput = relative(process.cwd(), output) chmodSync(output, mode.toString(8).slice(-3)) @@ -48,7 +51,7 @@ export default async function cli(compiler: NexeCompiler, next: () => Promise