Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: install gh cli if not present (#39)
* feature: added a check if the gh cli binary needs to be installed * enhancement: added the dependency check
- Loading branch information
1 parent
e3f254e
commit b002600
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# check if gh binary is available | ||
if [ -x "$(command -v gh)" ]; then | ||
echo 'gh cli is installed.' | ||
exit 0 | ||
fi | ||
|
||
version=${GH_CLI_VERSION:-2.8.0} | ||
echo "Installing gh cli in version: $version" | ||
|
||
wget https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz | ||
tar -xvf gh_${version}_linux_amd64.tar.gz | ||
sudo cp $(pwd)/gh_${version}_linux_amd64/bin/gh /usr/local/bin/ |