Remove updateInfo imports from old version and add to gitignore

This commit is contained in:
Maki
2026-01-10 23:26:05 +08:00
parent 4b1c7c653c
commit 6335cea98b
5 changed files with 26 additions and 22 deletions
+6 -1
View File
@@ -11,4 +11,9 @@ package-lock.json
/uploads
files.db
users.db
users.db
/pvfiles
/staticfiles
.env
-1
View File
@@ -1,6 +1,5 @@
import { Express, Request, Response } from "express";
import Logger from "../util/Logger";
import "../updateInfo";
import bcrypt from "bcrypt";
import { db } from "../util/database";
-1
View File
@@ -1,6 +1,5 @@
import { Express, Request, Response } from "express";
import Logger from "../util/Logger";
import "../updateInfo";
import bcrypt from "bcrypt";
import { db } from "../util/database";
-1
View File
@@ -1,6 +1,5 @@
import { Express, Request, Response, json } from "express";
import Logger from '../util/Logger'
import '../updateInfo'
var c = new Logger("Server(Pages)", "gray")
import dotenv from "dotenv";
+20 -18
View File
@@ -43,19 +43,19 @@ export function bytesToSize(bytes: number, decimals = 2) {
)} ${sizes[index]}`;
}
function waitUntil(conditionFn: () => boolean, interval = 100): Promise<void> {
return new Promise((resolve) => {
const timer = setInterval(() => {
try {
if (conditionFn()) {
clearInterval(timer);
resolve();
}
} catch (err) {
clearInterval(timer);
}
}, interval);
});
export function waitUntil(conditionFn: () => boolean, interval = 100): Promise<void> {
return new Promise((resolve) => {
const timer = setInterval(() => {
try {
if (conditionFn()) {
clearInterval(timer);
resolve();
}
} catch (err) {
clearInterval(timer);
}
}, interval);
});
}
import fs from 'fs'
@@ -74,13 +74,15 @@ export async function mkDirsManIfNotExists(paths: string[]): Promise<boolean> {
try {
var pass = false
for (const path in paths) {
await waitUntil(() => pass = true)
paths.forEach((path: string) => {
//await waitUntil(() => pass = true)
pass = false
if (!fs.existsSync(path))
if (!fs.existsSync(path)) {
console.log("Path does not exist: " + path)
fs.mkdir(path, () => pass = true);
}
}
})
return true
} catch {
return false