File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ builds:
1414 - amd64
1515archive :
1616 name_template : " hashnode-{{ .Os }}-{{ .Arch }}"
17+ format_overrides :
18+ - goos : windows
19+ format : zip
20+ files :
21+ - none*
1722checksum :
1823 name_template : ' checksums.txt'
1924snapshot :
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # set -x
3+ set -eo pipefail
4+ #! /bin/bash
5+
6+ GREEN=' \033[0;32m'
7+ NC=' \033[0m'
8+ RED=' \033[0;31m'
9+
10+ if [[ $EUID -ne 0 ]]; then
11+ echo -e " ${RED} This script must be run as root, please try again with sudo${NC} "
12+ exit 1
13+ fi
14+
15+ if ! [ -x " $( command -v tar) " ]; then
16+ echo ' Error: curl is not installed.' >&2
17+ exit 1
18+ fi
19+
20+ BINARY_NAME=" hashnode"
21+ HOST_OS=${HOST_OS:- $(uname | tr ' [:upper:]' ' [:lower:]' )}
22+
23+ if [[ $( uname -m) == " x86_64" ]]; then
24+ HOST_ARCH=" amd64"
25+ else
26+ HOST_ARCH=${HOST_ARCH:- $(uname -m)}
27+ fi
28+
29+ ARTIFACT_NAME=${BINARY_NAME} -${HOST_OS} -${HOST_ARCH} .tar.gz
30+
31+ LATEST_RELEASE=$( curl -L -s -H ' Accept: application/json' https://github.com/hashnode/hashnode-cli/releases/latest)
32+ LATEST_VERSION=$( echo $LATEST_RELEASE | sed -e ' s/.*"tag_name":"\([^"]*\)".*/\1/' )
33+ ARTIFACT_URL=" https://github.com/hashnode/hashnode-cli/releases/download/$LATEST_VERSION /$ARTIFACT_NAME "
34+
35+ curl -L $ARTIFACT_URL | tar xvz
36+ mv hashnode /usr/local/bin/hashnode
37+
38+
39+ echo -e " ${GREEN} Installed Successfully${NC} "
40+
You can’t perform that action at this time.
0 commit comments