Skip to content

Commit 6ce66b3

Browse files
committed
fix(shim): update bin/vp.cmd to call vp.cmd instead of vp.exe on Windows
After renaming vp.exe to vp-raw.exe, the bin/vp.cmd shim was still pointing to the non-existent vp.exe. Now it correctly calls current/bin/vp.cmd which wraps vp-raw.exe.
1 parent 149e473 commit 6ce66b3

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

packages/tools/src/install-global-cli.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,24 @@ exec "$VITE_PLUS_HOME/current/bin/vp.cmd" "$@"
155155
writeFileSync(bashPath, bashContent);
156156
console.log(`\nCreated wrapper scripts: ${cmdPath}, ${bashPath}`);
157157
} else {
158-
// For 'vp', create bash script wrapper for Git Bash
159-
// (install.ps1 already creates vp.cmd for cmd.exe/PowerShell, but we need to update it)
158+
// For 'vp', update bin/vp.cmd to call vp.cmd instead of vp.exe
159+
// (install.ps1 creates it pointing to vp.exe, but we renamed that to vp-raw.exe)
160+
const cmdPath = path.join(binDir, 'vp.cmd');
161+
const cmdContent = `@echo off\r
162+
set VITE_PLUS_HOME=${installDir}\r
163+
"%VITE_PLUS_HOME%\\current\\bin\\vp.cmd" %*\r
164+
exit /b %ERRORLEVEL%\r
165+
`;
166+
writeFileSync(cmdPath, cmdContent);
167+
168+
// Also create bash script wrapper for Git Bash
160169
const bashPath = path.join(binDir, 'vp');
161170
const bashContent = `#!/bin/bash
162171
export VITE_PLUS_HOME="${installDir}"
163172
exec "$VITE_PLUS_HOME/current/bin/vp.cmd" "$@"
164173
`;
165174
writeFileSync(bashPath, bashContent);
166-
console.log(`\nCreated bash wrapper: ${bashPath}`);
175+
console.log(`\nCreated wrapper scripts: ${cmdPath}, ${bashPath}`);
167176
}
168177
} else {
169178
// Unix: Rename vp -> vp-raw, create wrapper

0 commit comments

Comments
 (0)