Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: version reporting on lith — write and find .commit-ref

The version function only checked cwd/public/.commit-ref (Netlify path).
On lith, cwd is /opt/ac/lith so the file was never found, causing stale
"50 behind" display. Now checks ../system/public/.commit-ref too.

Also: deploy.fish writes .commit-ref after pull, excludes .netlify from
rsync to prevent stalls on edge function cache files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+16 -10
+2 -1
lith/deploy.fish
··· 126 126 127 127 # Sync repo (git pull on remote) 128 128 echo -e "$GREEN-> Pulling latest code...$NC" 129 - ssh -i $SSH_KEY $LITH_USER@$TARGET_HOST "cd $REMOTE_DIR && git pull origin main" 129 + ssh -i $SSH_KEY $LITH_USER@$TARGET_HOST "cd $REMOTE_DIR && git pull origin main && git rev-parse --short HEAD > system/public/.commit-ref" 130 130 131 131 # Overlay local working tree changes so deploys include uncommitted routing/frontend edits. 132 132 echo -e "$GREEN-> Syncing local lith/ and system/ working tree...$NC" ··· 140 140 --exclude node_modules \ 141 141 --exclude .env \ 142 142 --exclude .DS_Store \ 143 + --exclude .netlify \ 143 144 "$REPO_ROOT/system/" \ 144 145 $LITH_USER@$TARGET_HOST:$REMOTE_DIR/system/ 145 146
+14 -9
system/netlify/functions/version.mjs
··· 4 4 import fs from "fs"; 5 5 import path from "path"; 6 6 7 - // Get deployed commit from file written during build (COMMIT_REF is not available at runtime) 7 + // Get deployed commit from file written during build/deploy 8 8 function getDeployedCommit() { 9 - try { 10 - // Try reading from the .commit-ref file created during build 11 - const commitRefPath = path.join(process.cwd(), "public", ".commit-ref"); 12 - const commit = fs.readFileSync(commitRefPath, "utf8").trim(); 13 - if (commit && commit.length >= 7) { 14 - return commit; 9 + // Check multiple locations: Netlify writes to cwd/public/, lith deploy writes to system/public/ 10 + const candidates = [ 11 + path.join(process.cwd(), "public", ".commit-ref"), 12 + path.join(process.cwd(), "..", "system", "public", ".commit-ref"), 13 + ]; 14 + for (const commitRefPath of candidates) { 15 + try { 16 + const commit = fs.readFileSync(commitRefPath, "utf8").trim(); 17 + if (commit && commit.length >= 7) { 18 + return commit; 19 + } 20 + } catch (e) { 21 + // File doesn't exist or can't be read — try next 15 22 } 16 - } catch (e) { 17 - // File doesn't exist or can't be read 18 23 } 19 24 return "unknown"; 20 25 }