diff options
author | 2023-09-25 09:22:47 -0300 | |
---|---|---|
committer | 2023-09-25 05:22:47 -0700 | |
commit | bbc70d2b73c80630a48cab5a24d8e00b07032e12 (patch) | |
tree | 25e3a34a9a2111aeec344df6eaccb713cf14afbd /src | |
parent | 3eca2c7feec21aad1a83902f4d449dd860c01a18 (diff) | |
download | bun-bbc70d2b73c80630a48cab5a24d8e00b07032e12.tar.gz bun-bbc70d2b73c80630a48cab5a24d8e00b07032e12.tar.zst bun-bbc70d2b73c80630a48cab5a24d8e00b07032e12.zip |
Fix create command with template prefixed with @ char #6007 (#6013)
* fix create command with template prefixed with @ char
* add typescript test for create command
* format test
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/bunx_command.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cli/bunx_command.zig b/src/cli/bunx_command.zig index 05d7d70df..2643d33a6 100644 --- a/src/cli/bunx_command.zig +++ b/src/cli/bunx_command.zig @@ -23,7 +23,8 @@ pub const BunxCommand = struct { var new_str = try allocator.allocSentinel(u8, input.len + prefixLength, 0); if (input[0] == '@') { - if (strings.indexAnyComptime(input, "/")) |index| { + if (strings.indexAnyComptime(input, "/")) |slashIndex| { + const index = slashIndex + 1; @memcpy(new_str[0..index], input[0..index]); @memcpy(new_str[index .. index + prefixLength], "create-"); @memcpy(new_str[index + prefixLength ..], input[index..]); |