diff options
author | Alex Tatiyants <atatiyan@gmail.com> | 2016-01-03 17:17:48 -0800 |
---|---|---|
committer | Alex Tatiyants <atatiyan@gmail.com> | 2016-01-03 17:17:48 -0800 |
commit | 5310ac7d8eb1838a6297117bc7f9fca70291f46a (patch) | |
tree | 28f54b184cb85f04e6d6720dd03258f3728fedde /tools/tasks/clean.ts |
initial commit
Diffstat (limited to 'tools/tasks/clean.ts')
-rw-r--r-- | tools/tasks/clean.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/tasks/clean.ts b/tools/tasks/clean.ts new file mode 100644 index 0000000..9f0ebf2 --- /dev/null +++ b/tools/tasks/clean.ts @@ -0,0 +1,34 @@ +import * as async from 'async'; +import * as del from 'del'; +import {APP_DEST, TEST_DEST, TMP_DIR} from '../config'; + +export = function clean(gulp, plugins, option) { + return function (done) { + + switch(option) { + case 'all' : cleanAll(done); break; + case 'dist' : cleanDist(done); break; + case 'test' : cleanTest(done); break; + case 'tmp' : cleanTmp(done); break; + default: done(); + } + + }; +}; + +function cleanAll(done) { + async.parallel([ + cleanDist, + cleanTest, + cleanTmp + ], done); +} +function cleanDist(done) { + del(APP_DEST, done); +} +function cleanTest(done) { + del(TEST_DEST, done); +} +function cleanTmp(done) { + del(TMP_DIR, done); +} |