chore: fix pre passing to atom.rc (#16311)

* chore: fix pre passing to versionH

* preTypes => preType
This commit is contained in:
Shelley Vohr 2019-01-07 13:41:07 -08:00 committed by GitHub
parent ff1c90b638
commit 2ac677228d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -12,6 +12,12 @@ const minimist = require('minimist')
const writeFile = promisify(fs.writeFile)
const readFile = promisify(fs.readFile)
const preType = {
NONE: 'none',
PARTIAL: 'partial',
FULL: 'full'
}
function parseCommandLine () {
let help
const opts = minimist(process.argv.slice(2), {
@ -164,8 +170,8 @@ async function updateWinRC (components) {
const arr = data.split('\n')
arr.forEach((line, idx) => {
if (line.includes('FILEVERSION')) {
arr[idx] = ` FILEVERSION ${utils.makeVersion(components, ',', true)}`
arr[idx + 1] = ` PRODUCTVERSION ${utils.makeVersion(components, ',', true)}`
arr[idx] = ` FILEVERSION ${utils.makeVersion(components, ',', preType.PARTIAL)}`
arr[idx + 1] = ` PRODUCTVERSION ${utils.makeVersion(components, ',', preType.PARTIAL)}`
} else if (line.includes('FileVersion')) {
arr[idx] = ` VALUE "FileVersion", "${utils.makeVersion(components, '.')}"`
arr[idx + 5] = ` VALUE "ProductVersion", "${utils.makeVersion(components, '.')}"`