fix: set input before name (so name can derive from input)
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
@@ -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
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user