remove some old cleanup code

This commit is contained in:
Philipp Kunz 2017-05-13 10:55:35 +02:00
parent bd3873a359
commit 2112b4527d
2 changed files with 13 additions and 38 deletions

View File

@ -10,17 +10,6 @@ let removeDist = function () {
plugins.beautylog.ora.text('cleaning dist folder');
return plugins.smartfile.fs.remove(paths.distDir);
};
/**
* remove .d.ts files from testDirctory
*/
let removeTestDeclarations = function () {
let done = q.defer();
plugins.smartfile.fs.listFileTree('./test/', '**/*.d.ts').then(fileArray => {
let fileArrayToRemove = plugins.smartpath.transform.toAbsolute(fileArray, process.cwd() + '//test/');
plugins.smartfile.fs.removeManySync(fileArrayToRemove);
done.resolve();
});
};
/**
* remove old pages
*/
@ -32,7 +21,6 @@ exports.run = function (configArg) {
plugins.beautylog.ora.text('cleaning up from previous builds...');
let done = q.defer();
removeDist()
.then(removeTestDeclarations)
.then(removePages)
.then(function () {
plugins.beautylog.ok('Cleaned up from previous builds!');

View File

@ -7,39 +7,26 @@ import plugins = require('./mod00.plugins')
* removes the dist directory which will be entirely rebuild
*/
let removeDist = function () {
plugins.beautylog.ora.text('cleaning dist folder')
return plugins.smartfile.fs.remove(paths.distDir)
}
/**
* remove .d.ts files from testDirctory
*/
let removeTestDeclarations = function () {
let done = q.defer()
plugins.smartfile.fs.listFileTree('./test/', '**/*.d.ts').then(fileArray => {
let fileArrayToRemove = plugins.smartpath.transform.toAbsolute(fileArray, process.cwd() + '//test/')
plugins.smartfile.fs.removeManySync(fileArrayToRemove)
done.resolve()
})
plugins.beautylog.ora.text('cleaning dist folder')
return plugins.smartfile.fs.remove(paths.distDir)
}
/**
* remove old pages
*/
let removePages = function () {
plugins.beautylog.ora.text('cleaning pages folder')
return plugins.smartfile.fs.remove(paths.pagesDir)
plugins.beautylog.ora.text('cleaning pages folder')
return plugins.smartfile.fs.remove(paths.pagesDir)
}
export let run = function (configArg) {
plugins.beautylog.ora.text('cleaning up from previous builds...')
let done = q.defer()
removeDist()
.then(removeTestDeclarations)
.then(removePages)
.then(function () {
plugins.beautylog.ok('Cleaned up from previous builds!')
done.resolve(configArg)
})
return done.promise
plugins.beautylog.ora.text('cleaning up from previous builds...')
let done = q.defer()
removeDist()
.then(removePages)
.then(function () {
plugins.beautylog.ok('Cleaned up from previous builds!')
done.resolve(configArg)
})
return done.promise
}