Skip to content

Commit ea9fc73

Browse files
xixixaoConvex, Inc.
authored and
Convex, Inc.
committed
CLI: Fix filling out empty env file and warning (#25337)
GitOrigin-RevId: 3becef238e406d077617a369550a99286a8933d3
1 parent be346a1 commit ea9fc73

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

npm-packages/convex/src/cli/lib/envvars.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,14 @@ async function envVarWriteConfig(
170170
if (oldValue === value) {
171171
return null;
172172
}
173-
if (Object.values(config).filter((v) => v === oldValue).length !== 1) {
174-
chalk.yellow(`Can't safely modify ${envFile}, please edit manually.`);
173+
if (
174+
oldValue !== "" &&
175+
Object.values(config).filter((v) => v === oldValue).length !== 1
176+
) {
177+
logWarning(
178+
ctx,
179+
chalk.yellow(`Can't safely modify ${envFile}, please edit manually.`),
180+
);
175181
return null;
176182
}
177183
return { envFile, envVar: existingEnvVar, existingFileContent };

0 commit comments

Comments
 (0)