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
8 changes: 4 additions & 4 deletions Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ bundles `lc` with the wrapper scripts (`lcreate`, `lcls`, `lclose`,

[source,sh]
----
$ curl -sLO https://github.com/rubyists/linear-cli/releases/latest/download/lc_macos_aarch64.tar.gz
$ curl -sLo SHA256SUMS https://github.com/rubyists/linear-cli/releases/latest/download/SHA256SUMS
$ curl --retry 5 --retry-all-errors -sLO https://github.com/rubyists/linear-cli/releases/latest/download/lc_macos_aarch64.tar.gz
$ curl --retry 5 --retry-all-errors -sLo SHA256SUMS https://github.com/rubyists/linear-cli/releases/latest/download/SHA256SUMS
Comment thread
bougyman marked this conversation as resolved.
$ grep -q lc_macos_aarch64.tar.gz SHA256SUMS && grep lc_macos_aarch64.tar.gz SHA256SUMS | shasum -a 256 -c - <1>
$ mkdir lc && tar -xzf lc_macos_aarch64.tar.gz -C lc
$ sudo mv lc/* /usr/local/bin/
Expand Down Expand Up @@ -94,7 +94,7 @@ See https://github.com/rubyists/homebrew-tap for the formula itself.

[source,sh]
----
$ curl -fsSL https://raw.githubusercontent.com/rubyists/linear-cli/main/install.sh | bash
$ curl --retry 5 --retry-all-errors -fsSL https://raw.githubusercontent.com/rubyists/linear-cli/main/install.sh | bash
----

Detects your platform, downloads and checksum-verifies the matching release
Expand All @@ -106,7 +106,7 @@ specific install directory.

[source,sh]
----
$ curl -fsSL https://raw.githubusercontent.com/rubyists/linear-cli/main/uninstall.sh | bash
$ curl --retry 5 --retry-all-errors -fsSL https://raw.githubusercontent.com/rubyists/linear-cli/main/uninstall.sh | bash
----

Removes exactly what `install.sh` installed, by replaying the manifest it
Expand Down
10 changes: 8 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,19 @@ fetch_lc() {

printf 'Downloading %s (%s)...\n' "$tarball" "$version" >&2

if ! curl -fsSL "$(release_url "$tarball")" -o "$tmp_dir/$tarball"
# --retry-all-errors: GitHub's release-download redirect chain
# occasionally drops the connection outright mid-stream (curl: (56)
# Connection died) - verified directly, reproduced it repeatedly, and
# confirmed plain --retry alone does NOT cover this specific error
# (it's outside curl's default retriable set), only succeeding once
# --retry-all-errors was added too.
if ! curl -fsSL --retry 5 --retry-all-errors "$(release_url "$tarball")" -o "$tmp_dir/$tarball"
Comment thread
bougyman marked this conversation as resolved.
then
printf 'error: failed to download %s\n' "$tarball" >&2
exit 1
fi

if ! curl -fsSL "$(release_url "SHA256SUMS")" -o "$tmp_dir/SHA256SUMS"
if ! curl -fsSL --retry 5 --retry-all-errors "$(release_url "SHA256SUMS")" -o "$tmp_dir/SHA256SUMS"
then
printf 'error: failed to download SHA256SUMS\n' >&2
exit 1
Expand Down