mirror of
https://gitee.com/zhangsken/opencode.git
synced 2026-10-16 10:30:01 +08:00
fix(cli): keep opencode2 as a working alias
This commit is contained in:
@@ -366,19 +366,14 @@ install_legacy_shim() {
|
||||
if [[ "$shim_os" == "windows" ]]; then
|
||||
cat > "$INSTALL_DIR/opencode2.cmd" <<'EOF'
|
||||
@echo off
|
||||
echo "opencode2" has been renamed to "opencode". Run "opencode" instead.
|
||||
echo.
|
||||
echo If you have OpenCode v1 installed, you may need to uninstall it so the "opencode" command launches the correct installation.
|
||||
exit /b 1
|
||||
"%~dp0opencode.exe" %*
|
||||
exit /b %errorlevel%
|
||||
EOF
|
||||
return
|
||||
fi
|
||||
cat > "$INSTALL_DIR/opencode2" <<'EOF'
|
||||
#!/bin/sh
|
||||
echo '"opencode2" has been renamed to "opencode". Run "opencode" instead.'
|
||||
echo
|
||||
echo 'If you have OpenCode v1 installed, you may need to uninstall it so the "opencode" command launches the correct installation.'
|
||||
exit 1
|
||||
exec "$(dirname "$0")/opencode" "$@"
|
||||
EOF
|
||||
chmod 755 "$INSTALL_DIR/opencode2"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user