You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
383 B
18 lines
383 B
6 months ago
|
import 'dotenv/config'
|
||
|
|
||
|
import { rm } from 'fs'
|
||
|
|
||
|
const args = process.argv
|
||
|
|
||
|
if (args.length < 3) throw new Error('No dir arg')
|
||
|
|
||
|
const dirType = args[2]
|
||
|
|
||
|
const dir = dirType === 'dist' ? './dist' : process.env.TINKR_DIR
|
||
|
|
||
|
if (dir === undefined) throw new Error('Missing tinkr directory config.')
|
||
|
|
||
|
rm(dir, { recursive: true }, () => {
|
||
|
console.log(`Done clearing directory ${dir}`)
|
||
|
})
|