2016-05-25 03:23:48 +00:00
|
|
|
import "typings-global";
|
2016-03-21 00:07:34 +00:00
|
|
|
import plugins = require("./npmts.plugins");
|
|
|
|
import paths = require("./npmts.paths");
|
2016-05-17 00:32:40 +00:00
|
|
|
import {npmtsOra} from "./npmts.promisechain";
|
2016-03-21 00:07:34 +00:00
|
|
|
|
2016-05-19 20:11:18 +00:00
|
|
|
let removeDist = function(){
|
2016-05-19 22:55:14 +00:00
|
|
|
npmtsOra.text("cleaning " + "dist".yellow + " folder");
|
2016-07-01 00:28:34 +00:00
|
|
|
return plugins.smartfile.fs.remove(paths.distDir);
|
2016-05-19 20:11:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
let removeTypings = function(){
|
2016-05-23 03:34:25 +00:00
|
|
|
let done = plugins.Q.defer();
|
2016-05-19 22:55:14 +00:00
|
|
|
npmtsOra.text("cleaning " + "typings".yellow + " folder");
|
2016-05-23 03:34:25 +00:00
|
|
|
if(false){
|
|
|
|
//plugins.smartfile.fsaction.remove(paths.typingsDir)
|
|
|
|
// .then(done.resolve);
|
|
|
|
} else {
|
|
|
|
done.resolve();
|
|
|
|
}
|
|
|
|
return done.promise;
|
2016-05-19 20:11:18 +00:00
|
|
|
};
|
|
|
|
|
2016-03-21 00:07:34 +00:00
|
|
|
export let run = function(configArg){
|
2016-05-17 00:32:40 +00:00
|
|
|
npmtsOra.text("cleaning up from previous builds...");
|
2016-03-21 00:07:34 +00:00
|
|
|
let done = plugins.Q.defer();
|
2016-05-19 20:11:18 +00:00
|
|
|
removeDist()
|
|
|
|
.then(removeTypings)
|
2016-03-21 00:07:34 +00:00
|
|
|
.then(function(){
|
2016-05-17 00:32:40 +00:00
|
|
|
plugins.beautylog.ok("Cleaned up from previous builds!");
|
2016-03-21 00:07:34 +00:00
|
|
|
done.resolve(configArg);
|
|
|
|
});
|
|
|
|
return done.promise;
|
|
|
|
};
|