mirror of
https://github.com/fccview/cronmaster.git
synced 2025-12-26 15:37:54 -05:00
18 lines
544 B
TypeScript
18 lines
544 B
TypeScript
import { join } from "path";
|
|
|
|
const isDocker = process.env.DOCKER === "true";
|
|
const SCRIPTS_DIR = isDocker ? "/app/scripts" : join(process.cwd(), "scripts");
|
|
|
|
export function getScriptPath(filename: string): string {
|
|
return join(SCRIPTS_DIR, filename);
|
|
}
|
|
|
|
export function getHostScriptPath(filename: string): string {
|
|
const hostProjectDir =
|
|
process.env.NEXT_PUBLIC_HOST_PROJECT_DIR || process.cwd();
|
|
const hostScriptsDir = join(hostProjectDir, "scripts");
|
|
return `bash ${join(hostScriptsDir, filename)}`;
|
|
}
|
|
|
|
export { SCRIPTS_DIR };
|