Skip to content

Commit e337936

Browse files
committed
add comment
1 parent 56bc16d commit e337936

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/cloudflare/src/cli/utils/run-wrangler.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ type WranglerOptions = {
1212
logging?: "all" | "error";
1313
};
1414

15+
/**
16+
* Prepends CLI flags with `--` so that certain package managers can pass args through to wrangler
17+
* properly.
18+
*
19+
* npm and yarn require `--` to be used, while pnpm and bun require that it is not used.
20+
*
21+
* @param options Build options.
22+
* @param args CLI args.
23+
* @returns Arguments with a passthrough flag injected when needed.
24+
*/
1525
function injectPassthroughFlagForArgs(options: BuildOptions, args: string[]) {
1626
if (options.packager !== "npm" && options.packager !== "yarn") {
1727
return args;

0 commit comments

Comments
 (0)