Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f610401
commit c57454a
Showing
1 changed file
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
'use strict'; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const chalk = require('chalk'); | ||
const rimraf = require('rimraf'); | ||
const fs = require('fs-extra'); | ||
const {Signale} = require('signale'); | ||
|
||
const {resolve} = path; | ||
const {green, yellow} = chalk.bold; | ||
|
||
const distPath = resolve(__dirname, '../dist'); | ||
|
||
const signale = new Signale({scope: 'Ao'}); | ||
|
||
if (fs.existsSync(distPath)) { | ||
try { | ||
rimraf.sync(distPath); | ||
console.log(green('✔ Cleaning up')); | ||
fs.removeSync(distPath); | ||
signale.success('Cleaned up'); | ||
} catch (err) { | ||
console.error(err); | ||
signale.error(err); | ||
} | ||
} else { | ||
console.log(yellow('Nothing to clean-up')); | ||
signale.warn('Nothing to clean up'); | ||
} |