fix: set input before name (so name can derive from input)

This commit is contained in:
calebboyd
2017-09-08 23:44:26 -05:00
parent 04fdd165a4
commit 7a7aaefa23
5 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -28,9 +28,9 @@
## Usage
- Existing application bundle:
- Application entrypoint:
`nexe my-app-bundle.js -o my-app`
`nexe my-app.js`
- stdin interface
+1 -1
View File
@@ -192,8 +192,8 @@ function normalizeOptionsAsync(input?: Partial<NexeOptions>): Promise<NexeOption
const opts = options as any
options.temp = process.env.NEXE_TEMP || join(options.cwd, '.nexe')
options.name = extractName(options)
options.input = findInput(options.input, options.cwd)
options.name = extractName(options)
options.loglevel = extractLogLevel(options)
options.flags = flattenFilter(opts.flag, options.flags)
options.targets = flattenFilter(opts.target, options.targets).map(getTarget)
+5 -3
View File
@@ -12,12 +12,14 @@ export default async function nodeRc(compiler: NexeCompiler, next: () => Promise
let value = options[key]
const isVar = /^[A-Z_]+$/.test(value)
value = isVar ? value : `"${value}"`
file.contents = file.contents.replace(new RegExp(`VALUE "${key}",*`), `VALUE "${key}", ${value}`)
file.contents = file.contents.replace(
new RegExp(`VALUE "${key}",*`),
`VALUE "${key}", ${value}`
)
})
;['PRODUCTVERSION', 'FILEVERSION'].forEach(x => {
if (options[x]) {
file.contents = file.contents.replace(new RegExp(x + ' .*$', 'm'),`${x} ${options[x]}`)
file.contents = file.contents.replace(new RegExp(x + ' .*$', 'm'), `${x} ${options[x]}`)
}
})
+2 -2
View File
@@ -16,7 +16,7 @@ function createBundle(filename: string, options: { name: string; minify: any; cw
}
const fuse = FuseBox.init({
cache: false,
log: Boolean(process.env.NEXE_BUNDLE_DEBUG) || false,
log: Boolean(process.env.NEXE_BUNDLE_LOG) || false,
homeDir: options.cwd,
sourceMaps: false,
writeBundles: false,
@@ -54,7 +54,7 @@ export default async function bundle(compiler: NexeCompiler, next: any) {
minify: compiler.options.compress
})
if (compiler.options.debugBundle) {
if ('string' === typeof compiler.options.debugBundle) {
await writeFileAsync(compiler.options.debugBundle, compiler.input)
}
+1
View File
@@ -0,0 +1 @@
console.log('hello world')