deploy: go-router.sh uploads into /opt/lchat/incoming/ (now a directory) (#390)
The auto-updater (updater.go) uses /opt/lchat/incoming as its download directory; the box's old scp-target FILE of the same name was converted during the auto-update rollout. Upload as a file inside the dir, stage it, remove it.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 file changed,
+6
−3
deploy/go-router.sh+6 −3
diff --git a/deploy/go-router.sh b/deploy/go-router.sh| index f03e8ef..474e6a7 100755 |
| --- a/deploy/go-router.sh |
| +++ b/deploy/go-router.sh |
| @@ -39,11 +39,14 @@ trap 'rm -f "$OUT"' EXIT |
| echo "Building branch '$BRANCH' ($VER) for linux/amd64..." |
| OUT="$OUT" ./deploy/build-linux.sh "$VER" |
| -echo "Uploading to $BOX:/opt/lchat/incoming..." |
| -scp -q "$OUT" "$BOX:/opt/lchat/incoming" |
| +# /opt/lchat/incoming is a DIRECTORY now (the auto-updater downloads into it |
| +# too — see updater.go); upload as a file inside it, staged then removed. |
| +echo "Uploading to $BOX:/opt/lchat/incoming/lchat-upload..." |
| +ssh "$BOX" 'mkdir -p /opt/lchat/incoming' |
| +scp -q "$OUT" "$BOX:/opt/lchat/incoming/lchat-upload" |
| echo "Staging on the box..." |
| -STAGE_OUT="$(ssh "$BOX" '/opt/lchat/lchat stage -file /opt/lchat/incoming')" |
| +STAGE_OUT="$(ssh "$BOX" '/opt/lchat/lchat stage -file /opt/lchat/incoming/lchat-upload && rm -f /opt/lchat/incoming/lchat-upload')" |
| echo " $STAGE_OUT" |
| STAGED_VER="$(echo "$STAGE_OUT" | awk '{print $2}')" |
| if [ "$STAGED_VER" != "$VER" ]; then |