script/bump-version.js
async function updateWinRC (components) {
  const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'win', 'atom.rc')
  const data = await readFile(filePath, 'utf8')
  const arr = data.split('\n')
  arr.forEach((line, idx) => {
    if (line.includes('FILEVERSION')) {
      arr[idx] = ` FILEVERSION ${utils.makeVersion(components, ',', utils.preType.PARTIAL)}`
      arr[idx + 1] = ` PRODUCTVERSION ${utils.makeVersion(components, ',', utils.preType.PARTIAL)}`
    } else if (line.includes('FileVersion')) {
      arr[idx] = `            VALUE "FileVersion", "${utils.makeVersion(components, '.')}"`
      arr[idx + 5] = `            VALUE "ProductVersion", "${utils.makeVersion(components, '.')}"`
    }
  })
  await writeFile(filePath, arr.join('\n'))
}
async function updateWinRC (components) {
  const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'win', 'atom.rc')
  const data = await readFile(filePath, 'utf8')
  const arr = data.split('\n')
  arr.forEach((line, idx) => {
    if (line.includes('FILEVERSION')) {
      arr[idx] = ` FILEVERSION ${utils.makeVersion(components, ',', utils.preType.PARTIAL)}`
      arr[idx + 1] = ` PRODUCTVERSION ${utils.makeVersion(components, ',', utils.preType.PARTIAL)}`
    } else if (line.includes('FileVersion')) {
      arr[idx] = `            VALUE "FileVersion", "${utils.makeVersion(components, '.')}"`
      arr[idx + 5] = `            VALUE "ProductVersion", "${utils.makeVersion(components, '.')}"`
    }
  })
  await writeFile(filePath, arr.join('\n'))
}
async function updateWinRC ( components ) { const filePath = path . resolve ( __dirname , '..' , 'atom' , 'browser' , 'resources' , 'win' , 'atom.rc' ) const data = await readFile ( filePath , 'utf8' ) const arr = data . split ( '\n' ) arr . forEach ( ( line , idx ) => { if ( line . includes ( 'FILEVERSION' ) ) { arr [ idx ] = ` ${ utils . makeVersion ( components , ',' , utils . preType . PARTIAL ) } ` arr [ idx + 1 ] = ` ${ utils . makeVersion ( components , ',' , utils . preType . PARTIAL ) } ` } else if ( line . includes ( 'FileVersion' ) ) { arr [ idx ] = ` ${ utils . makeVersion ( components , '.' ) } ` arr [ idx + 5 ] = ` ${ utils . makeVersion ( components , '.' ) } ` } } ) await writeFile ( filePath , arr . join ( '\n' ) ) }
updates atom.rc file with new semver values
updates atom . rc file with new semver values