Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankcorn committed Jan 9, 2025
1 parent a60613b commit 3bd3768
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .changeset/silver-plums-brake.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@
"wrangler": minor
---

Add support for env files to wrangler secret bulk
Add support for env files to wrangler secret bulk i.e. `.dev.vars`

Run `wrangler secret bulk .dev.vars` to add the env file

```env
//.dev.vars
KEY=VALUE
KEY_2=VALUE
```

This will upload the secrets KEY and KEY_2 to your worker
2 changes: 1 addition & 1 deletion packages/wrangler/src/__tests__/secret.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ describe("wrangler secret", () => {
"wrangler secret:bulk [json]
POSITIONALS
json The file of key-value pairs to upload, as JSON in form {\\"key\\": value, ...} or .env file in the form KEY=VALUE [string]
json The file of key-value pairs to upload, as JSON in form {\\"key\\": value, ...} or .dev.vars file in the form KEY=VALUE [string]
GLOBAL FLAGS
-c, --config Path to Wrangler configuration file [string]
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/pages/secret/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const secret = (secretYargs: CommonYargsArgv, subHelp: SubHelp) => {
(yargs) => {
return yargs
.positional("json", {
describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .env file in the form KEY=VALUE`,
describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`,
type: "string",
})
.option("project-name", {
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/secret/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ export const secret = (secretYargs: CommonYargsArgv) => {
export const secretBulkOptions = (yargs: CommonYargsArgv) => {
return yargs
.positional("json", {
describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .env file in the form KEY=VALUE`,
describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`,
type: "string",
})
.option("name", {
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/versions/secrets/bulk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const versionsSecretBulkCommand = createCommand({
},
args: {
json: {
describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .env file in the form KEY=VALUE`,
describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`,
type: "string",
},
name: {
Expand Down

0 comments on commit 3bd3768

Please sign in to comment.