Skip to content

Commit

Permalink
polish: tweak the message when .dev.vars is used (#897)
Browse files Browse the repository at this point in the history
This tweaks the mssage when a `.dev.vars` file is used so that it doesn't imply that the user has to copy the values from it into their `wrangler.toml`.
  • Loading branch information
threepointone authored May 4, 2022
1 parent 57c1354 commit d0801b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/brave-pens-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

polish: tweak the message when `.dev.vars` is used

This tweaks the mssage when a `.dev.vars` file is used so that it doesn't imply that the user has to copy the values from it into their `wrangler.toml`.
2 changes: 1 addition & 1 deletion packages/wrangler/src/__tests__/dev.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ describe("wrangler dev", () => {
UNQUOTED: "unquoted value", // Note that whitespace is trimmed
});
expect(std.out).toMatchInlineSnapshot(
`"Add vars defined in \\".dev.vars\\" to the \\"vars\\" bindings."`
`"Using vars defined in .dev.vars"`
);
expect(std.warn).toMatchInlineSnapshot(`""`);
expect(std.err).toMatchInlineSnapshot(`""`);
Expand Down
4 changes: 1 addition & 3 deletions packages/wrangler/src/dev/dev-vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export function getVarsForDev(config: Config): Config["vars"] {
const devVarsPath = path.resolve(configDir, ".dev.vars");
if (fs.existsSync(devVarsPath)) {
const devVarsRelativePath = path.relative(process.cwd(), devVarsPath);
logger.log(
`Add vars defined in "${devVarsRelativePath}" to the "vars" bindings.`
);
logger.log(`Using vars defined in ${devVarsRelativePath}`);
const devVars = dotenv.parse(fs.readFileSync(devVarsPath, "utf8"));
return {
...config.vars,
Expand Down

0 comments on commit d0801b7

Please sign in to comment.