Skip to content

Commit 6dd1e23

Browse files
CarmenPopoviciupi0
andauthored
feat(wrangler): support --cwd cli argument (#8253)
This commit adds the `--cwd` global argument to the `wrangler` CLI to allow changing the current working directory before running any command. Co-authored-by: Pooya Parsa <[email protected]>
1 parent a9a4c33 commit 6dd1e23

32 files changed

+141
-14
lines changed

.changeset/khaki-years-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Add `--cwd` global argument to the `wrangler` CLI to allow changing the current working directory before running any command.

packages/wrangler/src/__tests__/ai.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe("ai help", () => {
2727
2828
GLOBAL FLAGS
2929
-c, --config Path to Wrangler configuration file [string]
30+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
3031
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
3132
-h, --help Show help [boolean]
3233
-v, --version Show version number [boolean]"
@@ -55,6 +56,7 @@ describe("ai help", () => {
5556
5657
GLOBAL FLAGS
5758
-c, --config Path to Wrangler configuration file [string]
59+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
5860
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
5961
-h, --help Show help [boolean]
6062
-v, --version Show version number [boolean]"

packages/wrangler/src/__tests__/cert.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ describe("wrangler", () => {
440440
441441
GLOBAL FLAGS
442442
-c, --config Path to Wrangler configuration file [string]
443+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
443444
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
444445
-h, --help Show help [boolean]
445446
-v, --version Show version number [boolean]"

packages/wrangler/src/__tests__/cloudchamber/create.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ describe("cloudchamber create", () => {
8787
8888
GLOBAL FLAGS
8989
-c, --config Path to Wrangler configuration file [string]
90+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
9091
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
9192
-h, --help Show help [boolean]
9293
-v, --version Show version number [boolean]

packages/wrangler/src/__tests__/cloudchamber/curl.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe("cloudchamber curl", () => {
4040
4141
GLOBAL FLAGS
4242
-c, --config Path to Wrangler configuration file [string]
43+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
4344
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
4445
-h, --help Show help [boolean]
4546
-v, --version Show version number [boolean]

packages/wrangler/src/__tests__/cloudchamber/delete.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe("cloudchamber delete", () => {
3636
3737
GLOBAL FLAGS
3838
-c, --config Path to Wrangler configuration file [string]
39+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
3940
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
4041
-h, --help Show help [boolean]
4142
-v, --version Show version number [boolean]

packages/wrangler/src/__tests__/cloudchamber/images.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe("cloudchamber image", () => {
3737
3838
GLOBAL FLAGS
3939
-c, --config Path to Wrangler configuration file [string]
40+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
4041
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
4142
-h, --help Show help [boolean]
4243
-v, --version Show version number [boolean]

packages/wrangler/src/__tests__/cloudchamber/list.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe("cloudchamber list", () => {
3737
3838
GLOBAL FLAGS
3939
-c, --config Path to Wrangler configuration file [string]
40+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
4041
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
4142
-h, --help Show help [boolean]
4243
-v, --version Show version number [boolean]

packages/wrangler/src/__tests__/cloudchamber/modify.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe("cloudchamber modify", () => {
7272
7373
GLOBAL FLAGS
7474
-c, --config Path to Wrangler configuration file [string]
75+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
7576
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
7677
-h, --help Show help [boolean]
7778
-v, --version Show version number [boolean]

packages/wrangler/src/__tests__/d1/d1.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe("d1", () => {
3030
3131
GLOBAL FLAGS
3232
-c, --config Path to Wrangler configuration file [string]
33+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
3334
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
3435
-h, --help Show help [boolean]
3536
-v, --version Show version number [boolean]"
@@ -66,6 +67,7 @@ describe("d1", () => {
6667
6768
GLOBAL FLAGS
6869
-c, --config Path to Wrangler configuration file [string]
70+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
6971
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
7072
-h, --help Show help [boolean]
7173
-v, --version Show version number [boolean]"
@@ -95,6 +97,7 @@ describe("d1", () => {
9597
9698
GLOBAL FLAGS
9799
-c, --config Path to Wrangler configuration file [string]
100+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
98101
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
99102
-h, --help Show help [boolean]
100103
-v, --version Show version number [boolean]"
@@ -123,6 +126,7 @@ describe("d1", () => {
123126
124127
GLOBAL FLAGS
125128
-c, --config Path to Wrangler configuration file [string]
129+
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
126130
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
127131
-h, --help Show help [boolean]
128132
-v, --version Show version number [boolean]"

0 commit comments

Comments
 (0)