diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 53e5ff766..9a53802ea 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -16,6 +16,7 @@ module.exports = (grunt) -> pkg: loadPkg() concat: + options: process: (src) -> src.replace /\r\n/g, '\n' coffee: src: [ 'src/General/Config.coffee' @@ -120,16 +121,16 @@ module.exports = (grunt) -> stderr: true failOnError: true 'templates-crx': - command: 'node_modules/.bin/coffee tools/templates.coffee tmp/script.coffee tmp/script-crx.coffee crx - <%= pkg.tests_enabled || "" %>' + command: 'node_modules/.bin/coffee tools/templates.coffee tmp/script.coffee tmp/script-crx.coffee crx - <%= pkg.tests_enabled || "" %>'.replace(/\//g, path.sep) 'templates-crx-meta': command: """ node_modules/.bin/coffee tools/templates.coffee src/meta/updates.xml testbuilds/updates<%= pkg.meta.suffix[pkg.channel] %>.xml crx <%= pkg.channel %> node_modules/.bin/coffee tools/templates.coffee src/meta/manifest.json testbuilds/crx<%= pkg.meta.suffix[pkg.channel] %>/manifest.json crx <%= pkg.channel %> - """.split('\n').join('&&') + """.split('\n').join('&&').replace(/\//g, path.sep) 'templates-userscript': - command: 'node_modules/.bin/coffee tools/templates.coffee tmp/script.coffee tmp/script-userscript.coffee userscript - <%= pkg.tests_enabled || "" %>' + command: 'node_modules/.bin/coffee tools/templates.coffee tmp/script.coffee tmp/script-userscript.coffee userscript - <%= pkg.tests_enabled || "" %>'.replace(/\//g, path.sep) 'templates-userscript-meta': - command: 'node_modules/.bin/coffee tools/templates.coffee src/meta/metadata.js testbuilds/<%= pkg.name %><%= pkg.meta.suffix[pkg.channel] %>.meta.js userscript <%= pkg.channel %>' + command: 'node_modules/.bin/coffee tools/templates.coffee src/meta/metadata.js testbuilds/<%= pkg.name %><%= pkg.meta.suffix[pkg.channel] %>.meta.js userscript <%= pkg.channel %>'.replace(/\//g, path.sep) commit: command: """ git commit -am "Release <%= pkg.meta.name %> v<%= pkg.meta.version %>." @@ -212,7 +213,7 @@ module.exports = (grunt) -> command: """ npm install --save-dev <%= Object.keys(pkg.devDependencies).filter(function(name) {return /^\\^/.test(pkg.devDependencies[name]);}).map(function(name) {return name+'@latest';}).join(' ') %> ./node_modules/.bin/npm-shrinkwrap --dev - """.split('\n').join('&&') + """.split('\n').join('&&').replace(/\//g, path.sep) webstore_upload: accounts: diff --git a/tools/templates.coffee b/tools/templates.coffee index 03f218d10..4a0394da2 100644 --- a/tools/templates.coffee +++ b/tools/templates.coffee @@ -6,7 +6,7 @@ glob = require 'glob' # disable ES6 delimiters _.templateSettings.interpolate = /<%=([\s\S]+?)%>/g -read = (filename) -> fs.readFileSync filename, 'utf8' +read = (filename) -> fs.readFileSync(filename, 'utf8').replace(/\r\n/g, '\n') pkg = JSON.parse(read 'package.json') _.assign pkg.meta, JSON.parse(read 'version.json')