mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
refactor: minor code cleanups
This commit is contained in:
committed by
Carlos Valente
parent
61280b06b7
commit
de9af5aaa2
@@ -1,28 +1,28 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility function to log messages in green
|
* Utility function to log success messages
|
||||||
*/
|
*/
|
||||||
export function consoleSuccess(message: string) {
|
export function consoleSuccess(message: string) {
|
||||||
console.log(inGreen(message));
|
console.log(inGreen(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility function to log messages in red
|
* Utility function to log error messages
|
||||||
*/
|
*/
|
||||||
export function consoleError(message: string) {
|
export function consoleError(message: string) {
|
||||||
console.error(inRed(message));
|
console.error(inRed(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility function to log messages with dimmed appearance
|
* Utility function to log highlighted messages
|
||||||
*/
|
*/
|
||||||
export function consoleHighlight(message: string) {
|
export function consoleHighlight(message: string) {
|
||||||
console.log(inCyan(message));
|
console.log(inCyan(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility function to log messages with dimmed appearance
|
* Utility function to log messages with subdued appearance
|
||||||
*/
|
*/
|
||||||
export function consoleSubdued(message: string) {
|
export function consoleSubdued(message: string) {
|
||||||
console.log(inGray(message));
|
console.log(inGray(message));
|
||||||
|
|||||||
@@ -58,10 +58,13 @@ export const storage = multer.diskStorage({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the directory that holds the uploads
|
||||||
|
*/
|
||||||
export async function clearUploadfolder() {
|
export async function clearUploadfolder() {
|
||||||
try {
|
try {
|
||||||
await rm(uploadsFolderPath, { recursive: true });
|
await rm(uploadsFolderPath, { recursive: true });
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
//we dont care that there was no folder
|
// we dont care that there was no folder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user