Remove updateInfo imports from old version and add to gitignore
This commit is contained in:
@@ -12,3 +12,8 @@ package-lock.json
|
|||||||
/uploads
|
/uploads
|
||||||
files.db
|
files.db
|
||||||
users.db
|
users.db
|
||||||
|
|
||||||
|
/pvfiles
|
||||||
|
/staticfiles
|
||||||
|
|
||||||
|
.env
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Express, Request, Response } from "express";
|
import { Express, Request, Response } from "express";
|
||||||
import Logger from "../util/Logger";
|
import Logger from "../util/Logger";
|
||||||
import "../updateInfo";
|
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { db } from "../util/database";
|
import { db } from "../util/database";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Express, Request, Response } from "express";
|
import { Express, Request, Response } from "express";
|
||||||
import Logger from "../util/Logger";
|
import Logger from "../util/Logger";
|
||||||
import "../updateInfo";
|
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { db } from "../util/database";
|
import { db } from "../util/database";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Express, Request, Response, json } from "express";
|
import { Express, Request, Response, json } from "express";
|
||||||
import Logger from '../util/Logger'
|
import Logger from '../util/Logger'
|
||||||
import '../updateInfo'
|
|
||||||
var c = new Logger("Server(Pages)", "gray")
|
var c = new Logger("Server(Pages)", "gray")
|
||||||
|
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
|
|||||||
+19
-17
@@ -43,19 +43,19 @@ export function bytesToSize(bytes: number, decimals = 2) {
|
|||||||
)} ${sizes[index]}`;
|
)} ${sizes[index]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function waitUntil(conditionFn: () => boolean, interval = 100): Promise<void> {
|
export function waitUntil(conditionFn: () => boolean, interval = 100): Promise<void> {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
try {
|
try {
|
||||||
if (conditionFn()) {
|
if (conditionFn()) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}
|
}
|
||||||
}, interval);
|
}, interval);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
@@ -74,13 +74,15 @@ export async function mkDirsManIfNotExists(paths: string[]): Promise<boolean> {
|
|||||||
try {
|
try {
|
||||||
var pass = false
|
var pass = false
|
||||||
|
|
||||||
for (const path in paths) {
|
paths.forEach((path: string) => {
|
||||||
await waitUntil(() => pass = true)
|
//await waitUntil(() => pass = true)
|
||||||
|
|
||||||
pass = false
|
pass = false
|
||||||
if (!fs.existsSync(path))
|
if (!fs.existsSync(path)) {
|
||||||
|
console.log("Path does not exist: " + path)
|
||||||
fs.mkdir(path, () => pass = true);
|
fs.mkdir(path, () => pass = true);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
return true
|
return true
|
||||||
} catch {
|
} catch {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user