tscoverage/ts/npmts.clean.ts
2016-09-22 23:23:16 +02:00

27 lines
754 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
}