mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: initial commit
This commit is contained in:
39
server/setup/config-paths.ts
Normal file
39
server/setup/config-paths.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { existsSync, mkdirSync } from "node:fs";
|
||||
import {
|
||||
APPLICATIONS_PATH,
|
||||
BASE_PATH,
|
||||
CERTIFICATES_PATH,
|
||||
LOGS_PATH,
|
||||
MONITORING_PATH,
|
||||
SSH_PATH,
|
||||
DYNAMIC_TRAEFIK_PATH,
|
||||
MAIN_TRAEFIK_PATH,
|
||||
} from "../constants";
|
||||
|
||||
const createDirectoryIfNotExist = (dirPath: string) => {
|
||||
if (!existsSync(dirPath)) {
|
||||
mkdirSync(dirPath, { recursive: true });
|
||||
console.log(`Directory created: ${dirPath}`);
|
||||
}
|
||||
};
|
||||
|
||||
export const setupDirectories = () => {
|
||||
const directories = [
|
||||
BASE_PATH,
|
||||
MAIN_TRAEFIK_PATH,
|
||||
DYNAMIC_TRAEFIK_PATH,
|
||||
LOGS_PATH,
|
||||
APPLICATIONS_PATH,
|
||||
SSH_PATH,
|
||||
CERTIFICATES_PATH,
|
||||
MONITORING_PATH,
|
||||
];
|
||||
|
||||
for (const dir of directories) {
|
||||
try {
|
||||
createDirectoryIfNotExist(dir);
|
||||
} catch (error) {
|
||||
console.log(error, " On path: ", dir);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user