create temporary backup dir if not exist
This commit is contained in:
parent
dc9dc5f083
commit
b70c7e0b3a
|
@ -96,8 +96,9 @@ function runCmd(cmd: string) {
|
|||
function getDateFolder() {
|
||||
const dir = path.resolve(__dirname, BACKUP_DIR);
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.error(`Backup directory ${BACKUP_DIR} does not exist!`);
|
||||
process.exit(1);
|
||||
// eslint-disable-next-line max-len
|
||||
console.error(`Backup directory ${BACKUP_DIR} does not exist! Trying to create it`);
|
||||
fs.mkdirSync(BACKUP_DIR);
|
||||
}
|
||||
const date = new Date();
|
||||
let month = date.getMonth() + 1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user