Skip bundled app install if already exists

This commit is contained in:
Chris Wanstrath 2026-02-27 19:35:06 -08:00
parent 604ac96b30
commit 4853ee4f7a
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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 })
},
})