clone

a personal forge on plain git: static pages, stacked-diff reviews, signed local ci, repo sites and releases

main
forge / test / scenarios / profile-set.sh
profile-set.sh 2.0K
1# Anyone sets what their own page says over ssh: profile prints it,2# profile bio, link and pin set it (rebuilding their page and the home3# page, and no one else's), --clear clears one. The page shows the bio, the link without its4# scheme, and the pinned repos in order; backups carry it.5. "$(dirname "$0")/../lib.sh"6user ana7user bob8repo bob/game9for r in notes cards site; do10 repo "ana/$r" "about $r"11 clone ana "ana/$r" "$T/w/$r"12 tick 360013 at "$T/w/$r" commit "first"14 push_as ana "$T/w/$r" origin main15done16export FORGE_STRICT=117build18p=$FORGE_WWW/ana/index.html19ok ssh_as ana profile20eq "$(output)" "bio: (none)21link: (none)22pin: (none: your page shows your 3 most recently active repos)"23mtime() { stat -c %Y "$1" 2>/dev/null || stat -f %m "$1"; }24bob=$(mtime "$FORGE_WWW/bob/index.html")25home=$(mtime "$FORGE_WWW/index.html")26sleep 127sync_builds28ok ssh_as ana profile bio 'writes <small> tools & games'29eq "$(mtime "$FORGE_WWW/bob/index.html")" "$bob"30[ "$(mtime "$FORGE_WWW/index.html")" != "$home" ] || fail "the home page wasn't rebuilt"31has "$T_LOG" "^your page's bio: writes <small> tools & games$"32has "$p" '<p class="bio">writes &lt;small&gt; tools &amp; games</p>'33ok ssh_as ana profile link https://ana.example/34has "$p" '<a class="link" href="https://ana.example/" rel="me nofollow">.*ana.example</a>'35ok ssh_as ana profile pin cards ana/notes36has "$p" '<h2>pinned</h2>'37eq "$(grep -o 'class="pin-name" href="/ana/[a-z]*/"' "$p" | sed 's|.*/ana/||; s|/"||' | tr '\n' ' ')" "cards notes "38ok ssh_as ana profile39eq "$(output)" "bio: writes <small> tools & games40link: https://ana.example/41pin: cards notes"42ok forge backup --dry-run43has "$FORGE_ROOT/.forge/backup/stage/.forge/profiles/ana" '^pin cards notes$'44ok ssh_as ana profile bio --clear45ok ssh_as ana profile link --clear46ok ssh_as ana profile pin --clear47lacks "$p" 'class="bio"|class="link"'48has "$p" '<h2>recently active</h2>'49ok ssh_as ana profile50eq "$(output)" "bio: (none)51link: (none)52pin: (none: your page shows your 3 most recently active repos)"