Skip to content

fix: make gimme.sh fail if download URL results in error#1

Open
davidxia wants to merge 1 commit intoksync:masterfrom
davidxia:patch1
Open

fix: make gimme.sh fail if download URL results in error#1
davidxia wants to merge 1 commit intoksync:masterfrom
davidxia:patch1

Conversation

@davidxia
Copy link
Copy Markdown

like 404.

I'm on Apple silicon Mac M1 where uname -m returns arm64 and ${DOWNLOAD_URL} is
https://github.com/ksync/ksync/releases/download/0.4.7-hotfix/ksync_darwin_arm64.

Before

❯ curl https://ksync.github.io/gimme-that/gimme.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2758  100  2758    0     0  34565      0 --:--:-- --:--:-- --:--:-- 36289
Checking GitHub for the latest release of ksync
Found release tag: 0.4.7-hotfix
Downloading ksync_darwin_arm64
No previous install found. Installing ksync to /usr/local/bin/ksync

❯ which ksync
/usr/local/bin/ksync

❯ ksync --help
/usr/local/bin/ksync: line 1: Not: command not found

❯ cat /usr/local/bin/ksync
Not found

After

❯ ~/Downloads/./gimme.sh
Checking GitHub for the latest release of ksync
Found release tag: 0.4.7-hotfix
Downloading ksync_darwin_arm64
No previous install found. Installing ksync to /usr/local/bin/ksync
curl: (22) The requested URL returned error: 404

like 404.

I'm on Apple silicon Mac M1 where `uname -m` returns `arm64`
and `${DOWNLOAD_URL}` is
https://github.com/ksync/ksync/releases/download/0.4.7-hotfix/ksync_darwin_arm64.

## Before

```
❯ curl https://ksync.github.io/gimme-that/gimme.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2758  100  2758    0     0  34565      0 --:--:-- --:--:-- --:--:-- 36289
Checking GitHub for the latest release of ksync
Found release tag: 0.4.7-hotfix
Downloading ksync_darwin_arm64
No previous install found. Installing ksync to /usr/local/bin/ksync

❯ which ksync
/usr/local/bin/ksync

❯ ksync --help
/usr/local/bin/ksync: line 1: Not: command not found

❯ cat /usr/local/bin/ksync
Not found
```

## After

```
❯ ~/Downloads/./gimme.sh
Checking GitHub for the latest release of ksync
Found release tag: 0.4.7-hotfix
Downloading ksync_darwin_arm64
No previous install found. Installing ksync to /usr/local/bin/ksync
curl: (22) The requested URL returned error: 404
```
@davidxia
Copy link
Copy Markdown
Author

@timfallmk @grampelberg 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant