mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Merge branch 'master' of gitlab.com:MrFry/mrfrys-node-server
This commit is contained in:
commit
ac0b4bfd87
3 changed files with 2054 additions and 1637 deletions
3656
package-lock.json
generated
3656
package-lock.json
generated
File diff suppressed because it is too large
Load diff
12
package.json
12
package.json
|
@ -3,24 +3,24 @@
|
||||||
"main": "src/server.js",
|
"main": "src/server.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/express": "^4.17.9",
|
"@types/express": "^4.17.9",
|
||||||
"@types/node": "^14.14.9",
|
"@types/node": "^15.0.1",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"better-sqlite3": "^6.0.1",
|
"better-sqlite3": "^7.1.5",
|
||||||
"connect-busboy": "0.0.2",
|
"connect-busboy": "0.0.2",
|
||||||
"cookie-parser": "^1.4.5",
|
"cookie-parser": "^1.4.5",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"ejs": "^1.0.0",
|
"ejs": "^3.1.6",
|
||||||
"eslint-plugin-typescript": "^0.14.0",
|
"eslint-plugin-typescript": "^0.14.0",
|
||||||
"express": "^4.6.1",
|
"express": "^4.6.1",
|
||||||
"express-ejs-layouts": "^1.1.0",
|
"express-ejs-layouts": "^2.5.0",
|
||||||
"express-fileupload": "^1.2.1",
|
"express-fileupload": "^1.2.1",
|
||||||
"queue-microtask": "^1.2.3",
|
"queue-microtask": "^1.2.3",
|
||||||
"sqlite3": "^4.1.1",
|
"sqlite3": "^5.0.2",
|
||||||
"ts-node": "^9.0.0",
|
"ts-node": "^9.0.0",
|
||||||
"typescript": "^4.1.2",
|
"typescript": "^4.1.2",
|
||||||
"typescript-eslint": "0.0.1-alpha.0",
|
"typescript-eslint": "0.0.1-alpha.0",
|
||||||
"url": "^0.11.0",
|
"url": "^0.11.0",
|
||||||
"uuid": "^7.0.3",
|
"uuid": "^8.3.2",
|
||||||
"vhost": "^3.0.2"
|
"vhost": "^3.0.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -121,12 +121,9 @@ function removePossibleAnswersDuplicates(path) {
|
||||||
count++
|
count++
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let removed = 0
|
||||||
dirs.forEach((currDir) => {
|
dirs.forEach((currDir) => {
|
||||||
const contents = fs.readdirSync(path + '/' + currDir)
|
const contents = fs.readdirSync(path + '/' + currDir)
|
||||||
let removed = 0
|
|
||||||
log(
|
|
||||||
`Processing ${C('green')}${currDir}${C()} (${contents.length} files) ...`
|
|
||||||
)
|
|
||||||
|
|
||||||
contents.forEach((currFile) => {
|
contents.forEach((currFile) => {
|
||||||
const currPath = path + '/' + currDir + '/' + currFile
|
const currPath = path + '/' + currDir + '/' + currFile
|
||||||
|
@ -173,10 +170,8 @@ function removePossibleAnswersDuplicates(path) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
log(`Removed ${C('red')}${removed}${C()} files`)
|
|
||||||
hr()
|
|
||||||
})
|
})
|
||||||
|
log(`Removed ${C('red')}${removed}${C()} files total`)
|
||||||
|
|
||||||
log(`${C('green')}Deleting empty directories ...${C()}`)
|
log(`${C('green')}Deleting empty directories ...${C()}`)
|
||||||
count = dirs.length
|
count = dirs.length
|
||||||
|
@ -415,14 +410,19 @@ function hr() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function log(text) {
|
function log(text) {
|
||||||
process.stdout.clearLine()
|
utils.AppendToFile(text, globalLog)
|
||||||
process.stdout.cursorTo(0)
|
if (process.stdout.isTTY) {
|
||||||
|
process.stdout.clearLine()
|
||||||
|
process.stdout.cursorTo(0)
|
||||||
|
}
|
||||||
|
|
||||||
console.log(text)
|
console.log(text)
|
||||||
utils.AppendToFile(text, globalLog)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeInSameLine(text, returnToLineStart) {
|
function writeInSameLine(text, returnToLineStart) {
|
||||||
|
if (!process.stdout.isTTY) {
|
||||||
|
return
|
||||||
|
}
|
||||||
process.stdout.clearLine()
|
process.stdout.clearLine()
|
||||||
process.stdout.cursorTo(0)
|
process.stdout.cursorTo(0)
|
||||||
process.stdout.write(text)
|
process.stdout.write(text)
|
||||||
|
@ -434,6 +434,9 @@ function writeInSameLine(text, returnToLineStart) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function printProgressBar(current, total) {
|
function printProgressBar(current, total) {
|
||||||
|
if (!process.stdout.isTTY) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const width = process.stdout.columns - 30
|
const width = process.stdout.columns - 30
|
||||||
|
|
||||||
if (width <= 0) {
|
if (width <= 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue