Fix terminal resize handling and cached updates
ci / test (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
Codex
2026-06-11 10:18:09 -04:00
parent 66c4c97c9d
commit 8ffbb07bfa
3 changed files with 104 additions and 10 deletions
+26 -5
View File
@@ -10,6 +10,7 @@ prefix="${PREFIX:-$HOME/.local}"
from_current=0
start_server=1
force_config=0
update_cache="${DOSH_UPDATE_CACHE:-$HOME/.cache/dosh/source}"
usage() {
cat <<'EOF'
@@ -22,11 +23,14 @@ Options:
--dosh-host HOST UDP host for Dosh packets when different from SSH target
--port PORT Dosh UDP port; default 50000
--prefix DIR Install prefix; default ~/.local
--update-cache DIR
Persistent source checkout for incremental updates
--no-start Install server but do not start it
--force-config Rewrite existing ~/.config/dosh/*.toml files
Environment alternatives:
DOSH_REPO, DOSH_ROLE, DOSH_SERVER, DOSH_HOST, DOSH_PORT, PREFIX
DOSH_REPO, DOSH_ROLE, DOSH_SERVER, DOSH_HOST, DOSH_PORT, PREFIX,
DOSH_UPDATE_CACHE
EOF
}
@@ -55,6 +59,10 @@ while [ "$#" -gt 0 ]; do
prefix="$2"
shift
;;
--update-cache)
update_cache="$2"
shift
;;
--from-current)
from_current=1
;;
@@ -119,15 +127,28 @@ else
echo "DOSH_REPO or --repo is required when running the installer from curl" >&2
exit 2
fi
case "$update_cache" in
""|"/"|"$HOME"|"$HOME/"|"$HOME/.cache")
echo "refusing unsafe update cache path: $update_cache" >&2
exit 2
;;
esac
need git
tmpdir="$(mktemp -d)"
git clone --depth 1 "$repo" "$tmpdir/dosh" >/dev/null
src_dir="$tmpdir/dosh"
mkdir -p "$(dirname "$update_cache")"
if [ -d "$update_cache/.git" ]; then
git -C "$update_cache" remote set-url origin "$repo"
git -C "$update_cache" fetch --depth 1 origin main
git -C "$update_cache" checkout -q -B main FETCH_HEAD
else
rm -rf "$update_cache"
git clone --depth 1 --branch main "$repo" "$update_cache" >/dev/null
fi
src_dir="$update_cache"
fi
cd "$src_dir"
if [ "$role" = "client" ]; then
cargo build --release --bin dosh-client --bin dosh-bench
cargo build --release --bin dosh-client
else
cargo build --release
fi