forked from extern/dockge
Env follow up (#231)
* Create the env file only if not empty * Update * Check some fs operation to async
This commit is contained in:
@@ -5,6 +5,7 @@ import { log } from "./log";
|
||||
import { ERROR_TYPE_VALIDATION } from "./util-common";
|
||||
import { R } from "redbean-node";
|
||||
import { verifyPassword } from "./password-hash";
|
||||
import fs from "fs";
|
||||
|
||||
export interface JWTDecoded {
|
||||
username : string;
|
||||
@@ -82,3 +83,9 @@ export async function doubleCheckPassword(socket : DockgeSocket, currentPassword
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
export function fileExists(file : string) {
|
||||
return fs.promises.access(file, fs.constants.F_OK)
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user