feat(cli): change destination directory

This commit is contained in:
Xmader 2020-11-26 14:49:54 -05:00
parent 6e48ef1253
commit 1680a35369
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
1 changed files with 13 additions and 0 deletions

View File

@ -99,6 +99,19 @@ void (async () => {
})
const filetypes = types.map(i => INDV_DOWNLOADS[i])
// destination directory
const { dest } = await inquirer.prompt({
type: 'input',
name: 'dest',
message: 'Destination Directory:',
validate (input: string) {
return input && fs.statSync(input).isDirectory()
},
default: process.cwd(),
})
// change working directory
process.chdir(dest)
// export files
spinner.start()
await Promise.all(