fix(cli): keep opencode2 as a working alias

This commit is contained in:
Dax Raad
2026-09-11 20:55:03 -04:00
parent b08ad82518
commit 0f26ad8787
5 changed files with 7 additions and 22 deletions
+3 -8
View File
@@ -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"
}