tscoverage/ts/npmts.clean.ts
2016-08-30 17:57:51 +02:00

26 lines
770 B
TypeScript

import "typings-global";
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
import {npmtsOra} from "./npmts.promisechain";
let removeDist = function(){
npmtsOra.text("cleaning dist folder");
return plugins.smartfile.fs.remove(paths.distDir);
};
let removePages = function(){
npmtsOra.text("cleaning pages folder");
return plugins.smartfile.fs.remove(paths.pagesDir);
};
export let run = function(configArg){
npmtsOra.text("cleaning up from previous builds...");
let done = plugins.Q.defer();
removeDist()
.then(removePages)
.then(function(){
plugins.beautylog.ok("Cleaned up from previous builds!");
done.resolve(configArg);
});
return done.promise;
};