Skip to content

Commit

Permalink
Add optional release name arg to install command
Browse files Browse the repository at this point in the history
  • Loading branch information
impredicative committed Jan 3, 2022
1 parent a8d8fb9 commit da3c284
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Refer to the [repo-specific commands](#repo-specific) section for details on usi
## Commands
### Repo-agnostic
* **`config <key> [<val>]`**: Get or set a value of key from configuration file `~/.gec`. To list all values, specify `-l`.
* **`install`**: Update to the latest release of `gec`.
* **`install [<release>]`**: Update to the named or latest release of `gec`.
* **`list`**: Alias of `ls`.
* **`ls [pattern]`**: List the output of the `state` command for matching repos in `~/gec/encrypted`. If specifying a pattern, it may need to be quoted.
* **`lock`**: Unmount all mounted repos.
Expand Down
6 changes: 5 additions & 1 deletion gec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ case "${CMD}" in
exit
;;
install)
release=$(curl -sS -f -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/impredicative/gec/releases | jq -r .[0].tag_name)
if [ "$#" -ge 2 ]; then
release="$2"
else
release=$(curl -sS -f -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/impredicative/gec/releases | jq -r .[0].tag_name)
fi
prog_file="$0"
sudo wget -q https://raw.githubusercontent.com/impredicative/gec/${release}/gec.sh -O "${prog_file}"
sudo chmod +x "${prog_file}"
Expand Down

0 comments on commit da3c284

Please sign in to comment.