"use server"; import { join } from "path"; const isDocker = process.env.DOCKER === "true"; const SCRIPTS_DIR = async () => { if (isDocker && process.env.HOST_PROJECT_DIR) { return `${process.env.HOST_PROJECT_DIR}/scripts`; } return join(process.cwd(), "scripts"); }; export const getScriptPath = async (filename: string): Promise => { return join(await SCRIPTS_DIR(), filename); } export const getHostScriptPath = async (filename: string): Promise => { const hostProjectDir = process.env.HOST_PROJECT_DIR || process.cwd(); const hostScriptsDir = join(hostProjectDir, "scripts"); return `bash ${join(hostScriptsDir, filename)}`; } export const normalizeLineEndings = (content: string): string => { return content.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); }; export { SCRIPTS_DIR };