Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
better exit handling for CLI install script to ensure cleanup of temp dir/temp files
Dane Schneider59bf40e678f5
diff --git a/app/cli/install.sh b/app/cli/install.shold mode 100644new mode 100755index 55d49de2..21dbfa6c--- a/app/cli/install.sh+++ b/app/cli/install.sh@@ -9,6 +9,15 @@ ARCH=VERSION=RELEASES_URL="https://github.com/plandex-ai/plandex/releases/download"+ # Ensure cleanup happens on exit and on specific signals+trap cleanup EXIT+trap cleanup INT TERM++cleanup () {+ cd "${SCRIPT_DIR}"+ rm -rf plandex_install_tmp+}+# Set platformcase "$(uname -s)" inDarwin)@@ -61,12 +70,6 @@ welcome_plandex () {echo ""}-cleanup () {- echo "Cleaning up..."- cd "${SCRIPT_DIR}"- rm -rf plandex_install_tmp-}-download_plandex () {ENCODED_TAG="cli%2Fv${VERSION}"@@ -102,7 +105,6 @@ download_plandex () {fielseecho >&2 'Error: /usr/local/bin does not exist. Create this directory with appropriate permissions, then re-install.'- cleanupexit 1fielif [ "$PLATFORM" == "windows" ]; then@@ -138,7 +140,6 @@ download_plandex () {welcome_plandexdownload_plandex-cleanupecho "Installation complete. Info:"echo ""