feat: productversion and fileversion replacements in node-rc

This commit is contained in:
calebboyd
2017-09-08 14:29:19 -05:00
parent 455d6893fd
commit 04fdd165a4
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -12,7 +12,13 @@ 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.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]}`)
}
})
return next()