Switch to rimraf module from rm for Windows compat, fix #764 (#765)

* Switch to rimraf module from rm for Windows compat, fix #764

* Move scripts to package.json

* Fix typo in preproduction, per review
This commit is contained in:
David Humphrey 2017-05-25 15:50:45 -04:00 коммит произвёл Gideon Thomas
Родитель eff8a2ce5b
Коммит 8a0261abf4
2 изменённых файлов: 8 добавлений и 9 удалений

Просмотреть файл

@ -405,9 +405,9 @@ module.exports = function (grunt) {
},
exec: {
localize: 'node scripts/properties2js',
'localize-dist': 'node scripts/properties2js dist',
'clean-nls': 'rm -fr src/nls && git checkout -- src/nls'
'localize': 'npm run localize',
'localize-dist': 'npm run localize-dist',
'unlocalize': 'npm run unlocalize'
},
swPrecache: {
@ -536,7 +536,7 @@ module.exports = function (grunt) {
/* XXXBramble: we skip this, since we don't use any of the node_modules in Bramble.
'npm-install', */
'cleanempty',
'exec:clean-nls',
'exec:unlocalize',
'usemin'
/* XXXBramble: we skip this, since we don't bother with its info, and copy it in copy:dist
'build-config' */
@ -559,9 +559,6 @@ module.exports = function (grunt) {
'compress:sw'
]);
// task: undo changes to the src/nls directory
grunt.registerTask('unlocalize', ['exec:clean-nls']);
// Default task.
grunt.registerTask('default', ['test']);
};

Просмотреть файл

@ -56,16 +56,18 @@
"properties-parser": "0.3.1",
"request": "^2.69.0",
"requirejs": "^2.3.3",
"rimraf": "^2.6.1",
"sw-precache": "^5.0.0",
"tar-fs": "^1.15.1"
},
"scripts": {
"localize": "node scripts/properties2js",
"localize-dist": "node scripts/properties2js dist",
"unlocalize": "rimraf src/nls && git checkout -- src/nls",
"postinstall": "grunt install",
"build": "grunt build-browser",
"preproduction": "grunt build-browser-compressed && grunt unlocalize",
"preproduction": "grunt build-browser-compressed && npm run unlocalize",
"production": "npm start -- --gzip",
"unlocalize": "grunt unlocalize",
"test": "grunt test && grunt build-browser-compressed",
"server": "http-server -p 8000 --cors",
"prestart": "npm run localize",