Print concrete next steps after a successful run
The summary just said "all OK" and left you to figure out what to do. Now it lists the tailnet hosts this run actually found and spells out the exact VS Code Remote-SSH steps to reach one, instead of assuming you remember from the design conversation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
48ad7c24e4
commit
0c742e6a2f
1 changed files with 26 additions and 0 deletions
26
bootstrap.sh
26
bootstrap.sh
|
|
@ -4,6 +4,7 @@ set -uo pipefail
|
||||||
STEP_NAMES=()
|
STEP_NAMES=()
|
||||||
STEP_STATUS=()
|
STEP_STATUS=()
|
||||||
STEP_DETAIL=()
|
STEP_DETAIL=()
|
||||||
|
KNOWN_HOSTS=()
|
||||||
|
|
||||||
step_ok() { STEP_NAMES+=("$1"); STEP_STATUS+=("OK"); STEP_DETAIL+=("${2:-}"); echo "[OK] $1"; }
|
step_ok() { STEP_NAMES+=("$1"); STEP_STATUS+=("OK"); STEP_DETAIL+=("${2:-}"); echo "[OK] $1"; }
|
||||||
step_skip() { STEP_NAMES+=("$1"); STEP_STATUS+=("SKIPPED"); STEP_DETAIL+=("${2:-}"); echo "[SKIPPED] $1 - ${2:-}"; }
|
step_skip() { STEP_NAMES+=("$1"); STEP_STATUS+=("SKIPPED"); STEP_DETAIL+=("${2:-}"); echo "[SKIPPED] $1 - ${2:-}"; }
|
||||||
|
|
@ -27,6 +28,30 @@ print_summary() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "All steps OK or already satisfied."
|
echo "All steps OK or already satisfied."
|
||||||
|
echo
|
||||||
|
echo "================== next steps ======================"
|
||||||
|
echo "1. Check you're actually on the tailnet:"
|
||||||
|
echo " tailscale status"
|
||||||
|
echo
|
||||||
|
if [ "${#KNOWN_HOSTS[@]}" -gt 0 ]; then
|
||||||
|
echo "2. Open VS Code, Ctrl+Shift+P -> 'Remote-SSH: Connect to Host...',"
|
||||||
|
echo " and pick one of the hosts this run found on your tailnet:"
|
||||||
|
for h in "${KNOWN_HOSTS[@]}"; do
|
||||||
|
echo " - $h"
|
||||||
|
done
|
||||||
|
echo " (a host you expect but don't see here just isn't on the tailnet"
|
||||||
|
echo " right now - check it's powered on and connected, then re-run"
|
||||||
|
echo " this script to refresh the list)"
|
||||||
|
else
|
||||||
|
echo "2. No other tailnet peers were found yet. Once your home machine is"
|
||||||
|
echo " online and joined to the tailnet, re-run this script to add it,"
|
||||||
|
echo " then use VS Code's 'Remote-SSH: Connect to Host...' to reach it."
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
echo "3. Once connected, File > Open Folder to browse that machine's"
|
||||||
|
echo " filesystem and get to your project - same as opening a folder"
|
||||||
|
echo " locally, just on the remote host."
|
||||||
|
echo "====================================================="
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------- phase 0: environment ----------
|
# ---------- phase 0: environment ----------
|
||||||
|
|
@ -227,6 +252,7 @@ EOF
|
||||||
)
|
)
|
||||||
while read -r name dns; do
|
while read -r name dns; do
|
||||||
[ -z "$name" ] && continue
|
[ -z "$name" ] && continue
|
||||||
|
KNOWN_HOSTS+=("$name")
|
||||||
new_block+=$(cat <<EOF
|
new_block+=$(cat <<EOF
|
||||||
|
|
||||||
Host $name
|
Host $name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue