1 | import * as program from 'commander';
|
2 | import * as path from 'path';
|
3 | import * as shell from 'shelljs';
|
4 | import { exit, isNutmegComponent, notifyOfUpdate } from './utils';
|
5 |
|
6 | notifyOfUpdate();
|
7 |
|
8 | program.command('clean <path>', "clean a Web Component's compiled files")
|
9 | .parse(process.argv);
|
10 |
|
11 | const workingDir = path.resolve(process.cwd(), program.args[0]);
|
12 | const distDir = path.resolve(workingDir, './dist');
|
13 |
|
14 | exit("Directory doesn't have a package.json with @nutmeg/seed as a dependancy.", !isNutmegComponent(workingDir));
|
15 |
|
16 | console.log(`Cleaning ${distDir}`);
|
17 |
|
18 | shell.exec(`rm -rf ${distDir}`);
|