cleanup
This commit is contained in:
parent
1bd47d2b60
commit
d15f1613f0
@ -43,13 +43,4 @@ export default class ServerManager {
|
||||
|
||||
logger.info("Finished pinging servers!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the servers.
|
||||
*
|
||||
* @returns the servers
|
||||
*/
|
||||
public getServers(): Server[] {
|
||||
return this.servers;
|
||||
}
|
||||
}
|
||||
|
@ -1,41 +0,0 @@
|
||||
import fs from "fs";
|
||||
|
||||
/**
|
||||
* Creates a directory at the given path.
|
||||
*
|
||||
* @param path the path to the file
|
||||
* @param recursive whether to create the directory tree if it doesn't exist (defaults to true)
|
||||
* @returns a promise that resolves when the file is created
|
||||
*/
|
||||
export async function createDirectory(
|
||||
path: string,
|
||||
recursive?: boolean
|
||||
): Promise<void> {
|
||||
if (recursive == undefined) {
|
||||
recursive = true; // Set to true by default
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.mkdir(path, { recursive: recursive }, (err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a file exists at the given path.
|
||||
*
|
||||
* @param path the path to the file
|
||||
* @returns a promise that returns true if the file exists, false otherwise
|
||||
*/
|
||||
export async function exists(path: string): Promise<boolean> {
|
||||
return new Promise((resolve) => {
|
||||
fs.exists(path, (exists) => {
|
||||
resolve(exists);
|
||||
});
|
||||
});
|
||||
}
|
@ -35,13 +35,4 @@ export default class WebsiteManager {
|
||||
|
||||
logger.info("Finished pinging websites!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the websites.
|
||||
*
|
||||
* @returns the websites
|
||||
*/
|
||||
public getWebsites(): Website[] {
|
||||
return this.websites;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user