Use ERB templates from Underscore-Plus

This commit is contained in:
Paul Betts
2014-09-16 15:41:57 -07:00
parent bc6c85ceca
commit 246575390a
2 changed files with 6 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore-plus'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
@@ -14,10 +15,10 @@ module.exports = (grunt) ->
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'})
inputTemplate = fs.readFileSync(path.join('build', 'windows', 'atom.nuspec.erb'), {encoding: 'utf8'})
targetNuspecPath = path.join(buildDir, 'atom.nuspec')
fs.writeFileSync(targetNuspecPath, inputTemplate.replace(/{{version}}/, packageInfo.version))
fs.writeFileSync(targetNuspecPath, _.template(inputTemplate, packageInfo))
cmd = 'build/windows/nuget.exe'
args = ['pack', targetNuspecPath, '-BasePath', atomDir, '-OutputDirectory', buildDir]

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>atom</id>
<version>{{version}}</version>
<id><%= name %></id>
<version><%= version %></version>
<authors>The Atom Community</authors>
<owners>The Atom Community</owners>
<iconUrl>http://f.cl.ly/items/0X3B1j1j010I0X1p3l0S/atom.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Atom for Windows</description>
<description><%= description %></description>
</metadata>
<files>
<file src="locales\**" target="lib\net45\locales" />