tscoverage/dist/npmts.clean.js

25 lines
920 B
JavaScript
Raw Normal View History

2016-03-21 00:07:34 +00:00
"use strict";
2016-05-19 20:11:18 +00:00
/// <reference path="./typings/index.d.ts" />
2016-03-21 00:07:34 +00:00
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
2016-05-17 00:32:40 +00:00
var npmts_promisechain_1 = require("./npmts.promisechain");
2016-05-19 20:11:18 +00:00
var removeDist = function () {
npmts_promisechain_1.npmtsOra.text("cleaning " + "dist".yellow + " folder");
2016-05-19 20:11:18 +00:00
return plugins.smartfile.fsaction.remove(paths.distDir);
};
var removeTypings = function () {
npmts_promisechain_1.npmtsOra.text("cleaning " + "typings".yellow + " folder");
return plugins.smartfile.fsaction.remove(paths.typingsDir);
2016-05-19 20:11:18 +00:00
};
2016-03-21 00:07:34 +00:00
exports.run = function (configArg) {
2016-05-17 00:32:40 +00:00
npmts_promisechain_1.npmtsOra.text("cleaning up from previous builds...");
2016-03-21 00:07:34 +00:00
var 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;
};