aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-22 23:37:18 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-22 23:37:18 -0800
commit85733abe79d27e69a29b036c318e4f8e733958ce (patch)
treea4eeb2fdb30b9aa80c5f4e725d6fa800853c1207
parent89625c0cc804932b219aff0ec00ca52aff22b20b (diff)
downloadbun-85733abe79d27e69a29b036c318e4f8e733958ce.tar.gz
bun-85733abe79d27e69a29b036c318e4f8e733958ce.tar.zst
bun-85733abe79d27e69a29b036c318e4f8e733958ce.zip
`npx` -> `bunx`
-rw-r--r--src/cli/run_command.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig
index e0ba11f83..a3f14bec2 100644
--- a/src/cli/run_command.zig
+++ b/src/cli/run_command.zig
@@ -178,6 +178,20 @@ pub const RunCommand = struct {
}
}
}
+
+ const npx_i = entry_i + "px ".len;
+ if (npx_i < script.len) {
+ const base = script[start..];
+ if (base.len > "px ".len) {
+ const remainder = base[0.."px ".len];
+ if (strings.eqlComptimeIgnoreLen(remainder, "px ")) {
+ try copy_script.appendSlice("bunx" ++ " ");
+ entry_i += remainder.len;
+ delimiter = 0;
+ continue;
+ }
+ }
+ }
}
delimiter = 0;