ghcurl 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/Gemfile +6 -6
- data/LICENSE +22 -22
- data/README.md +102 -103
- data/Rakefile +3 -3
- data/bin/ghcurl +584 -525
- data/ghcurl.gemspec +40 -0
- data/lib/ghcurl.rb +79 -71
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66d379bffcc0e6eb6439349e0a0e7b738c8b23f2a752d7246df6cf9e3186be5d
|
4
|
+
data.tar.gz: 625dad075628b20b39c8481986be7a174d5c617a11be15ead35d7e3168aedd2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 757a89f46b1e133a46944f9a4515c22b83bbd5337e61b9d82bd8c4155b24b54bbeb36da79bed0d9ff12316be1c58e26d9dd92ae86d6ed92f87df64262d3796ca
|
7
|
+
data.tar.gz: 154de96859d2ab27eba969c159dc7d461c710184a69021c59cfe424de5b8da83f250be2d3981e9d5594e2392dab4b5fa5400467e6fd03c66360468c6b77900ef
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [Unreleased](#) (2022-11-13)
|
4
|
+
|
5
|
+
<br>
|
6
|
+
|
7
|
+
## [v0.9.0](#) (2022-11-13)
|
8
|
+
|
9
|
+
### Enhancements:
|
10
|
+
|
11
|
+
- Update gem 'octokit' from 4.22 to 6.0
|
12
|
+
- Add Windows support
|
13
|
+
|
14
|
+
<br>
|
15
|
+
|
16
|
+
## [Initialize](#) (2022-04-12)
|
17
|
+
|
18
|
+
Initialize the project.
|
19
|
+
|
20
|
+
<br>
|
21
|
+
|
22
|
+
<hr>
|
23
|
+
|
24
|
+
This Changelog is maintained with [chlog](https://github.com/ccmywish/chlog)
|
25
|
+
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in ghcurl.gemspec
|
6
|
-
gemspec
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in ghcurl.gemspec
|
6
|
+
gemspec
|
data/LICENSE
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2022 ccmywish
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 ccmywish
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,103 +1,102 @@
|
|
1
|
-
<div align="center">
|
2
|
-
|
3
|
-
# ghcurl
|
4
|
-
|
5
|
-
[](https://rubygems.org/gems/ghcurl)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
ghcurl cli/cli
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
<br>
|
1
|
+
<div align="center">
|
2
|
+
|
3
|
+
# ghcurl
|
4
|
+
|
5
|
+
[](https://rubygems.org/gems/ghcurl)
|
6
|
+
|
7
|
+
Download files and install from Github releases.
|
8
|
+
|
9
|
+
It works on Linux, Windows, macOS and maybe other OSes.
|
10
|
+
|
11
|
+
```bash
|
12
|
+
gem install ghcurl
|
13
|
+
```
|
14
|
+
|
15
|
+
</div>
|
16
|
+
|
17
|
+
`ghcurl` can recognize your OS and arch, give you the proper option to download. You can search by regular expression, specify a version, and install it to a path or according to the environment variable `GHCURL_BIN_PATH` or just `/usr/local/bin`. It will automatically extract a tar/zip file to make the installation process better.
|
18
|
+
|
19
|
+
<br>
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```bash
|
24
|
+
$ ghcurl [user/]repo [regexp] [options]
|
25
|
+
```
|
26
|
+
|
27
|
+
**-o**
|
28
|
+
|
29
|
+
This is optional, download will default to `~/.cache/ghcurl`
|
30
|
+
1. `-o path` Download into path
|
31
|
+
2. `-o path/name` Download as path/name
|
32
|
+
|
33
|
+
**-v**
|
34
|
+
1. `-v 1.0.0` Download tag version 1.0.0
|
35
|
+
2. `-v3.1.4` This is also OK to download tag version 3.1.4
|
36
|
+
|
37
|
+
**-i**
|
38
|
+
1. `-i` Install to `/usr/local/bin` or `GHCURL_BIN_PATH`
|
39
|
+
2. `-i path` Install to path
|
40
|
+
|
41
|
+
**-r**
|
42
|
+
1. `-r name` Install the binary as name
|
43
|
+
|
44
|
+
<br>
|
45
|
+
|
46
|
+
## Example
|
47
|
+
|
48
|
+
Things can be easier. We consider these as popular binaries: https://github.com/ibraheemdev/modern-unix
|
49
|
+
|
50
|
+
Notice: `-i` means to install.
|
51
|
+
|
52
|
+
```bash
|
53
|
+
# It knows that's sharkdp/fd
|
54
|
+
ghcurl fd -i
|
55
|
+
|
56
|
+
# It's cli/cli !
|
57
|
+
ghcurl gh -i
|
58
|
+
|
59
|
+
# Much easier to install rbspy!
|
60
|
+
ghcurl rbspy -i
|
61
|
+
```
|
62
|
+
|
63
|
+
Download latest deb/rpm package and install, notice the argument `deb` / `rpm` are just regular expressions.
|
64
|
+
```bash
|
65
|
+
ghcurl cli/cli deb -i
|
66
|
+
ghcurl cli/cli rpm -i
|
67
|
+
```
|
68
|
+
|
69
|
+
Normal download
|
70
|
+
```bash
|
71
|
+
# The easiest way to download
|
72
|
+
ghcurl gh
|
73
|
+
|
74
|
+
# Download to /tmp
|
75
|
+
ghcurl gh -o /tmp
|
76
|
+
|
77
|
+
# Download latest rbspy-x86_64-unknown-linux-gnu.tar.gz to ~/.cache/ghcurl
|
78
|
+
ghcurl rbspy/rbspy 'x86_64.*linux'
|
79
|
+
|
80
|
+
# Download rbspy version 0.11.1
|
81
|
+
ghcurl rbspy/rbspy 'x86_64.*linux' -v0.11.1
|
82
|
+
```
|
83
|
+
|
84
|
+
Download a binary and install it to anywhere
|
85
|
+
```bash
|
86
|
+
# Install to /usr/local/bin
|
87
|
+
ghcurl starship linux-gnu -i
|
88
|
+
|
89
|
+
# Install to ~/tmp/bin
|
90
|
+
ghcurl BetaPictoris/timeleft -i ~/tmp/bin
|
91
|
+
|
92
|
+
# Download as /tmp/github-cli and install
|
93
|
+
ghcurl gh -o /tmp/github-cli -i
|
94
|
+
|
95
|
+
# Install and rename it to, here, 'tldr' in /usr/local/bin
|
96
|
+
ghcurl dbrgn/tealdeer x86_64 -i -r 'tldr'
|
97
|
+
|
98
|
+
# or, like this
|
99
|
+
ghcurl dlvhdr/gh-dash linux-amd64 -i ~/tmp/bin/gd
|
100
|
+
```
|
101
|
+
|
102
|
+
<br>
|
data/Rakefile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
task default: %i[]
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
task default: %i[]
|