From da08e6dc2ee66edec1e3ac679086344e490608dd Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 10 Apr 2016 03:04:05 -0700 Subject: [PATCH] tools/clean.js --- Gruntfile.coffee | 9 ++++-- npm-shrinkwrap.json | 70 --------------------------------------------- package.json | 1 - tools/clean.js | 5 ++++ 4 files changed, 11 insertions(+), 74 deletions(-) create mode 100644 tools/clean.js diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 16c399a90..654c283b8 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -76,6 +76,8 @@ module.exports = (grunt) -> stdout: true stderr: true failOnError: true + clean: + command: 'node tools/clean.js' general: command: """ <%= BIN %>coffee tools/templates.coffee src/meta/jshint.json .jshintrc @@ -185,9 +187,6 @@ module.exports = (grunt) -> shrinkwrap: command: '<%= BIN %>npm-shrinkwrap --dev' - clean: - builds: ['tmp', 'testbuilds', 'builds'] - require('load-grunt-tasks') grunt grunt.registerTask 'default', [ @@ -273,6 +272,10 @@ module.exports = (grunt) -> 'build-userscript' ] + grunt.registerTask 'clean', [ + 'shell:clean' + ] + grunt.registerTask 'full', [ 'build' 'sign' diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c82f1a88f..806a70237 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1211,76 +1211,6 @@ } } }, - "grunt-contrib-clean": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.0.0.tgz", - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" - }, - "rimraf": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz", - "dependencies": { - "glob": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz", - "dependencies": { - "inflight": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - }, - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "minimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "dependencies": { - "brace-expansion": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", - "dependencies": { - "balanced-match": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - } - } - } - } - }, - "once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - }, - "path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - } - } - } - } - } - } - }, "grunt-shell": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/grunt-shell/-/grunt-shell-1.2.1.tgz", diff --git a/package.json b/package.json index 0ef5d10db..7b3d472c4 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "glob": "^7.0.3", "grunt": "^1.0.1", "grunt-concurrent": "^2.3.0", - "grunt-contrib-clean": "^1.0.0", "grunt-shell": "^1.2.1", "jshint": "^2.9.1", "jszip": "^2.6.0", diff --git a/tools/clean.js b/tools/clean.js new file mode 100644 index 000000000..dc7b32c85 --- /dev/null +++ b/tools/clean.js @@ -0,0 +1,5 @@ +var fs = require('fs-extra'); + +fs.removeSync('tmp'); +fs.removeSync('testbuilds'); +fs.removeSync('builds');