trigger.dev
Version:
A Command-Line Interface for Trigger.dev projects
15 lines • 530 B
JavaScript
import { constants } from "node:fs";
import { open } from "node:fs/promises";
export async function writePrivateEnvFile(outputPath, content, flags) {
const openFlags = flags === "wx" ? flags : constants.O_WRONLY | constants.O_CREAT;
const file = await open(outputPath, openFlags, 0o600);
try {
await file.chmod(0o600);
await file.truncate(0);
await file.writeFile(content, { encoding: "utf8" });
}
finally {
await file.close();
}
}
//# sourceMappingURL=privateEnvFile.js.map