This repository was archived by the owner on Nov 17, 2026. It is now read-only.
Repository navigation
♻️ Restore pages deploy as a shell script and harden the shell commands - #860
Merged
Merged
Conversation
- Add `#!/bin/sh` shebangs; without them execution relies on the shell's ENOEXEC fallback - Quote "$0" in `dirname` so paths containing spaces resolve correctly - Guard `cd` with `|| exit 1` so a failed chdir cannot run the script against the wrong directory - Drop the brackets in `tr '[A-Z]' '[a-z]'`; tr treats them as literal characters, not class delimiters
- Replace `commands/deploy.js` with `commands/deploy.sh`: rsync and ssh are POSIX binaries, so the JS wrapper added code without adding portability - Restore `rsync -ahvu`; the `u` (`--update`) flag was silently dropped in the JS rewrite - Create parent directories with `ssh mkdir -p` before rsync, which only creates the last path segment - Split `DEPLOY_TARGET` into `DEPLOY_HOST` / `DEPLOY_DIR` so the mkdir and rsync targets share one source - Delete `commands/update-snapshots.js`; `"test:update": "UPDATE_SNAPSHOTS=1 bun test"` is already cross-platform because `bun run` executes scripts through Bun Shell on Windows - Point the docs at `commands/deploy.sh` instead of enumerating its variables, and note that `--delete` mirrors `public/` - Fix the command list in `public/index.html`: add `cd apps/pages` and use `bun run`, since bare `bun build`/`bun test` launch Bun's bundler and test runner
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts the
apps/pagesdeploy command from.jsback to.sh. The.jsrewrite was motivated by cross-platform support, butdeployorchestratesrsyncandssh— POSIX binaries that are absent on Windows — so wrapping them in JS added code without adding portability. Script bodies go from 80 lines to 23.Which extension is right follows from what a command depends on, not from uniformity:
.sh.js(clean-images,add-size-to-imgstay as-is)package.jsonDeploy
commands/deploy.jswithcommands/deploy.shrsync -ahvu— theu(--update) flag was silently dropped in the JS rewritessh mkdir -pbefore rsync, which only creates the last path segmentDEPLOY_TARGETintoDEPLOY_HOST/DEPLOY_DIRso the mkdir and rsync targets share one sourceSnapshot update
commands/update-snapshots.js(33 lines) in favor of"test:update": "UPDATE_SNAPSHOTS=1 bun test"bun runexecutespackage.jsonscripts through Bun Shell on Windows, so the env prefix is already cross-platformFixes found along the way
public/index.htmlwas not runnable: it had nocd apps/pages, and barebun build/bun testlaunch Bun's built-in bundler and test runner instead of the package scriptscommands/*.shhad no shebangs, so execution relied on the shell's ENOEXEC fallback. Also quoted"$0", guardedcdwith|| exit 1, and dropped the literal brackets intr '[A-Z]' '[a-z]'rsync/sshon the local machine. Also documented that--deletemirrorspublic/commands/deploy.shinstead of enumerating its variables — theDEPLOY_TARGETrename rippling through four places was the cost of that duplicationVerification
bun run lint(5/5), pages tests (7 pass), shellcheck clean.