fix project cleaning

This commit is contained in:
Philipp Kunz 2016-08-30 17:57:51 +02:00
parent 8c633b3c30
commit 4a17953298
2 changed files with 10 additions and 23 deletions

16
dist/npmts.clean.js vendored
View File

@ -4,24 +4,18 @@ var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths"); var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain"); var npmts_promisechain_1 = require("./npmts.promisechain");
var removeDist = function () { var removeDist = function () {
npmts_promisechain_1.npmtsOra.text("cleaning " + "dist".yellow + " folder"); npmts_promisechain_1.npmtsOra.text("cleaning dist folder");
return plugins.smartfile.fs.remove(paths.distDir); return plugins.smartfile.fs.remove(paths.distDir);
}; };
var removeTypings = function () { var removePages = function () {
var done = plugins.Q.defer(); npmts_promisechain_1.npmtsOra.text("cleaning pages folder");
npmts_promisechain_1.npmtsOra.text("cleaning " + "typings".yellow + " folder"); return plugins.smartfile.fs.remove(paths.pagesDir);
if (false) {
}
else {
done.resolve();
}
return done.promise;
}; };
exports.run = function (configArg) { exports.run = function (configArg) {
npmts_promisechain_1.npmtsOra.text("cleaning up from previous builds..."); npmts_promisechain_1.npmtsOra.text("cleaning up from previous builds...");
var done = plugins.Q.defer(); var done = plugins.Q.defer();
removeDist() removeDist()
.then(removeTypings) .then(removePages)
.then(function () { .then(function () {
plugins.beautylog.ok("Cleaned up from previous builds!"); plugins.beautylog.ok("Cleaned up from previous builds!");
done.resolve(configArg); done.resolve(configArg);

View File

@ -4,27 +4,20 @@ import paths = require("./npmts.paths");
import {npmtsOra} from "./npmts.promisechain"; import {npmtsOra} from "./npmts.promisechain";
let removeDist = function(){ let removeDist = function(){
npmtsOra.text("cleaning " + "dist".yellow + " folder"); npmtsOra.text("cleaning dist folder");
return plugins.smartfile.fs.remove(paths.distDir); return plugins.smartfile.fs.remove(paths.distDir);
}; };
let removeTypings = function(){ let removePages = function(){
let done = plugins.Q.defer(); npmtsOra.text("cleaning pages folder");
npmtsOra.text("cleaning " + "typings".yellow + " folder"); return plugins.smartfile.fs.remove(paths.pagesDir);
if(false){
//plugins.smartfile.fsaction.remove(paths.typingsDir)
// .then(done.resolve);
} else {
done.resolve();
}
return done.promise;
}; };
export let run = function(configArg){ export let run = function(configArg){
npmtsOra.text("cleaning up from previous builds..."); npmtsOra.text("cleaning up from previous builds...");
let done = plugins.Q.defer(); let done = plugins.Q.defer();
removeDist() removeDist()
.then(removeTypings) .then(removePages)
.then(function(){ .then(function(){
plugins.beautylog.ok("Cleaned up from previous builds!"); plugins.beautylog.ok("Cleaned up from previous builds!");
done.resolve(configArg); done.resolve(configArg);