Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ drops you into its persistent `work` tmux session over your own tailnet.

## Install

The repo is private, so install through an authenticated
[GitHub CLI](https://cli.github.com) (`brew install gh`, then `gh auth login`):

```sh
gh api repos/JumpstartLab/work/contents/install.sh -H 'Accept: application/vnd.github.raw' | sh
curl -fsSL https://raw.githubusercontent.com/JumpstartLab/work/main/install.sh | sh
work login
work
```
Expand Down
11 changes: 2 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ bin_dir="${WORK_BIN_DIR:-$HOME/.local/bin}"
asset="work-$os-$arch"
base="https://github.com/$repo/releases/latest/download"
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
# The repo is private: anonymous release downloads 404, so use an authenticated
# gh when there is one (collaborators run `gh auth login` once), curl otherwise.
if command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1; then
gh release download -R "$repo" -p "$asset" -p checksums.txt -D "$tmp"
else
curl -fsSL "$base/$asset" -o "$tmp/$asset" || {
echo "download failed: $repo is private. Install gh, run 'gh auth login', and re-run." >&2; exit 1; }
curl -fsSL "$base/checksums.txt" -o "$tmp/checksums.txt"
fi
curl -fsSL "$base/$asset" -o "$tmp/$asset"
curl -fsSL "$base/checksums.txt" -o "$tmp/checksums.txt"
(cd "$tmp" && grep " $asset\$" checksums.txt | { command -v sha256sum >/dev/null && sha256sum -c - || shasum -a 256 -c -; })
mkdir -p "$bin_dir"
install -m 755 "$tmp/$asset" "$bin_dir/work"
Expand Down
Loading