Populate atom.nuspec with the current Atom version

This commit is contained in:
Paul Betts
2014-09-16 15:09:30 -07:00
parent 54b89cebcc
commit a0b405fe6f
2 changed files with 8 additions and 2 deletions

View File

@@ -13,8 +13,14 @@ module.exports = (grunt) ->
buildDir = grunt.config.get('atom.buildDir')
atomDir = path.join(buildDir, 'Atom')
packageInfo = JSON.parse(fs.readFileSync(path.join(atomDir, 'resources', 'app', 'package.json'), {encoding: 'utf8'}))
inputTemplate = fs.readFileSync(path.join('build', 'windows', 'atom.nuspec.hbs'), {encoding: 'utf8'})
targetNuspecPath = path.join(buildDir, 'atom.nuspec')
fs.writeFileSync(targetNuspecPath, inputTemplate.replace(/{{version}}/, packageInfo.version))
cmd = 'build/windows/nuget.exe'
args = ['pack', './build/windows/atom.nuspec', '-BasePath', atomDir, '-OutputDirectory', buildDir]
args = ['pack', targetNuspecPath, '-BasePath', atomDir, '-OutputDirectory', buildDir]
spawn {cmd, args}, (error, result, code) ->
if error?

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>atom</id>
<version>0.123.0</version>
<version>{{version}}</version>
<authors>The Atom Community</authors>
<owners>The Atom Community</owners>
<iconUrl>http://f.cl.ly/items/0X3B1j1j010I0X1p3l0S/atom.ico</iconUrl>