Skip to content

Commit 8fa6239

Browse files
committed
Do stuff
1 parent 986c49e commit 8fa6239

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

run.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
11
const prompt = require("prompt-sync")
2+
const chalk = require("chalk")
3+
const path = require('path');
4+
const warn = function(message, color){
5+
if (!color) color = red
6+
console.log(chalk[color](message))
7+
}
8+
9+
10+
if (path.existsSync("/data")) { // or fs.existsSync
11+
warn("WARNING: Folder \"data\" will be erased and rebuilt if you proceed")
12+
const answer = prompt("Would you like to proceed? (S/N)")
13+
if (String(answer).toUpperCase=="S"){
14+
//delete
15+
console.log("Done")
16+
} else if (String(answer).toUpperCase=="N"){
17+
console.log("Goodbye!")
18+
exit(0)
19+
}else{
20+
warn("Not a valid answer. Exiting...")
21+
exit(1)
22+
}
23+
}

tools/lib.js

Whitespace-only changes.

0 commit comments

Comments
 (0)