Skip to content

Commit 6b4b161

Browse files
authored
Merge pull request #2 from J-P-S-O/master
Master
2 parents 618defa + 8fa6239 commit 6b4b161

5 files changed

Lines changed: 46 additions & 1 deletion

File tree

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"dependencies": {
3+
"chalk": "^5.0.0",
34
"prompt-sync": "^4.2.0"
45
}
56
}

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+
}

templates/start.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<html>
22
<head>
3-
<title>Upload something</title>
3+
<title>Upload something</title>
44
</head>
5+
<body>
6+
7+
</body>
58
<script>
9+
let sessioncode = "\\code"
10+
611
</script>
712

813
</html>

tools/lib.js

Whitespace-only changes.

0 commit comments

Comments
 (0)