From 4853ee4f7a9307d6099bd3f6744c1fc708c20f16 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 27 Feb 2026 19:35:06 -0800 Subject: [PATCH] Skip bundled app install if already exists --- install/install.sh | 10 +++++++--- install/server.ts | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/install/install.sh b/install/install.sh index 8c6860e..53fcdf2 100644 --- a/install/install.sh +++ b/install/install.sh @@ -91,12 +91,16 @@ echo ">> Installing bundled apps" BUNDLED_APPS="clock code cron env stats versions" for app in $BUNDLED_APPS; do if [ -d "$DEST/apps/$app" ]; then + if [ -d ~/apps/"$app" ]; then + echo " $app (exists, skipping)" + continue + fi echo " $app" cp -r "$DEST/apps/$app" ~/apps/ - version_dir=$(ls -1 ~/apps/$app | grep -E '^[0-9]{8}-[0-9]{6}$' | sort -r | head -1) + version_dir=$(ls -1 ~/apps/"$app" | grep -E '^[0-9]{8}-[0-9]{6}$' | sort -r | head -1) if [ -n "$version_dir" ]; then - ln -sfn "$version_dir" ~/apps/$app/current - (cd ~/apps/$app/current && bun install --frozen-lockfile) > /dev/null 2>&1 || true + ln -sfn "$version_dir" ~/apps/"$app"/current + (cd ~/apps/"$app"/current && bun install --frozen-lockfile) > /dev/null 2>&1 || true fi fi done diff --git a/install/server.ts b/install/server.ts index 8e62548..45db375 100644 --- a/install/server.ts +++ b/install/server.ts @@ -10,7 +10,7 @@ Bun.serve({ headers: { "content-type": "text/plain" }, }) } - return new Response("toes", { status: 404 }) + return new Response("404 Not Found", { status: 404 }) }, })