mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 14:37:26 +00:00
A failed install left the machine with no CLI at all. do_install ran `rm -rf "$SRC_DIR"` and only then built; if the build failed, or the run was interrupted, what remained was an unbuilt tree, a wrapper still pointing at the dist/ that was never produced, and the previous run's install.json still claiming success. Every later `logicsrc` invocation died with MODULE_NOT_FOUND, and nothing said why. That is what happened here: install.json dated 01:57, src/ replaced at 02:59 by a second run that did not finish. Now the download, npm install and build all happen in a staging directory, and $SRC_DIR is only touched once packages/cli/dist/index.js actually exists -- the file the wrapper execs, so its absence is exactly the failure the user would otherwise hit on their next command. Staging sits inside $LOGICSRC_HOME so the swap is a rename on one filesystem rather than a cross-device copy of node_modules, and the previous tree is kept until the swap succeeds so a failed move can be undone. Build output was going to /dev/null, so "build failed" carried no reason at all. It is captured now, with the last 25 lines printed on failure and the full log left on disk. Also validates the commit id from the GitHub API before recording it: anything that is not 40 hex characters is dropped rather than written into install.json, which `logicsrc update` compares against. Verified against a stubbed npm/curl in all three paths: a failing build leaves the existing install running, a build that produces no artifact is caught, and a clean install still swaps in and writes a correct manifest. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| commandboard-api | ||
| commandboard-web | ||
| logicsrc-web | ||
| pwa | ||