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() {
|
function getDateFolder() {
|
||||||
const dir = path.resolve(__dirname, BACKUP_DIR);
|
const dir = path.resolve(__dirname, BACKUP_DIR);
|
||||||
if (!fs.existsSync(dir)) {
|
if (!fs.existsSync(dir)) {
|
||||||
console.error(`Backup directory ${BACKUP_DIR} does not exist!`);
|
// eslint-disable-next-line max-len
|
||||||
process.exit(1);
|
console.error(`Backup directory ${BACKUP_DIR} does not exist! Trying to create it`);
|
||||||
|
fs.mkdirSync(BACKUP_DIR);
|
||||||
}
|
}
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
let month = date.getMonth() + 1;
|
let month = date.getMonth() + 1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user