Skip to content

Commit e7c1337

Browse files
committed
Restrict pemissions on env files created with env pull
1 parent 87014d5 commit e7c1337

File tree

1 file changed

+2
-2
lines changed
  • packages/cli-v3/src/commands

1 file changed

+2
-2
lines changed

packages/cli-v3/src/commands/env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ async function _envPullCommand(options: z.infer<typeof EnvPullOptions>) {
385385

386386
const outputPath = resolve(process.cwd(), options.output);
387387

388-
const [error] = await tryCatch(writeFile(outputPath, "", { flag: "wx" }));
388+
const [error] = await tryCatch(writeFile(outputPath, "", { flag: "wx", mode: 0o600 }));
389389

390390
if (error && "code" in error && error.code !== "EEXIST") {
391391
throw error;
@@ -407,7 +407,7 @@ async function _envPullCommand(options: z.infer<typeof EnvPullOptions>) {
407407

408408
$spinner.start(`Writing to ${options.output}`);
409409
const [writeError] = await tryCatch(
410-
writeFile(outputPath, envContent + "\n", { encoding: "utf-8" })
410+
writeFile(outputPath, envContent + "\n", { encoding: "utf-8", mode: 0o600 })
411411
);
412412

413413
if (writeError) {

0 commit comments

Comments
 (0)