tscoverage/dist/mod_compile/mod.clean.js

31 lines
921 B
JavaScript
Raw Normal View History

2016-03-21 01:07:34 +01:00
"use strict";
2017-02-27 22:19:14 +01:00
Object.defineProperty(exports, "__esModule", { value: true });
2017-01-18 00:58:09 +01:00
const q = require("smartq");
2016-10-21 17:48:52 +02:00
const paths = require("../npmts.paths");
2017-11-28 17:33:55 +01:00
const plugins = require("./mod.plugins");
2016-09-29 16:19:49 +02:00
/**
* removes the dist directory which will be entirely rebuild
*/
2016-09-22 23:23:16 +02:00
let removeDist = function () {
2017-01-21 23:23:00 +01:00
plugins.beautylog.ora.text('cleaning dist folder');
2016-07-01 02:28:34 +02:00
return plugins.smartfile.fs.remove(paths.distDir);
2016-05-19 22:11:18 +02:00
};
2016-09-29 16:19:49 +02:00
/**
* remove old pages
*/
2016-09-22 23:23:16 +02:00
let removePages = function () {
2017-01-21 23:23:00 +01:00
plugins.beautylog.ora.text('cleaning pages folder');
2016-08-30 17:57:51 +02:00
return plugins.smartfile.fs.remove(paths.pagesDir);
2016-05-19 22:11:18 +02:00
};
2016-03-21 01:07:34 +01:00
exports.run = function (configArg) {
2017-01-21 23:23:00 +01:00
plugins.beautylog.ora.text('cleaning up from previous builds...');
2016-10-02 20:35:13 +02:00
let done = q.defer();
2016-05-19 22:11:18 +02:00
removeDist()
2016-08-30 17:57:51 +02:00
.then(removePages)
2016-03-21 01:07:34 +01:00
.then(function () {
2016-09-06 17:21:25 +02:00
plugins.beautylog.ok('Cleaned up from previous builds!');
2016-03-21 01:07:34 +01:00
done.resolve(configArg);
});
return done.promise;
};