From 8be6ac041814d57da865a4c19f396786c9163f53 Mon Sep 17 00:00:00 2001 From: AIPass Date: Thu, 16 Apr 2026 13:56:22 -0700 Subject: [PATCH] =?UTF-8?q?feat(system):=20fix(setup):=20warn=20on=20Windo?= =?UTF-8?q?ws=20when=20shadowing=20drone=20installs=20are=20detected=20(#3?= =?UTF-8?q?17=20system=20Python=20pip=20aipass,=20#321=20legacy=20npm=20ai?= =?UTF-8?q?pass-drone=20scripts)=20=E2=80=94=20prints=20precise=20uninstal?= =?UTF-8?q?l=20commands,=20doesn't=20auto-modify=20the=20user's=20system?= =?UTF-8?q?=20(#343)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: @devpulse --- setup.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/setup.sh b/setup.sh index b80a7103..5860db3d 100755 --- a/setup.sh +++ b/setup.sh @@ -105,6 +105,39 @@ echo "Upgrading pip ..." echo "Installing aipass in editable mode (with dev extras) ..." "$VENV_PYTHON" -m pip install -e ".[dev]" --quiet +# --- Detect shadowing drone installs (Windows) --- +# Issues #317 + #321: system-Python pip or legacy npm aipass-drone can shadow venv drone.exe. +# Warn the user with precise uninstall commands; don't touch anything automatically. +if [ "$IS_WINDOWS" -eq 1 ]; then + echo "" + echo "Checking for shadowing drone installs ..." + + # System Python check (#317) + for sys_py in "python" "py -3" "python3"; do + if command -v $sys_py &>/dev/null; then + if $sys_py -m pip show aipass &>/dev/null 2>&1; then + # Don't match our own venv python + SYS_PY_PATH=$($sys_py -c "import sys; print(sys.executable)" 2>/dev/null || echo "") + if [ -n "$SYS_PY_PATH" ] && [[ "$SYS_PY_PATH" != *".venv"* ]]; then + echo " WARN: aipass is installed in system Python at $SYS_PY_PATH" + echo " This shadows the venv drone.exe on Windows PATH. To fix:" + echo " \"$SYS_PY_PATH\" -m pip uninstall aipass -y" + break + fi + fi + fi + done + + # Legacy npm aipass-drone check (#321) + NPM_BIN="$APPDATA/npm" + if [ -d "$NPM_BIN" ] && { [ -f "$NPM_BIN/drone" ] || [ -f "$NPM_BIN/drone.cmd" ] || [ -f "$NPM_BIN/drone.ps1" ]; }; then + echo " WARN: Legacy npm drone scripts found in $NPM_BIN — these shadow venv drone.exe." + echo " To fix:" + echo " npm uninstall -g aipass-drone" + echo " rm -f \"$NPM_BIN/drone\" \"$NPM_BIN/drone.cmd\" \"$NPM_BIN/drone.ps1\"" + fi +fi + # --- Verify CLI entry points --- FAIL=0