File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # set -x
3+ set -eo pipefail
4+
5+ BINARY_NAME=" hashnode"
6+ HOST_OS=${HOST_OS:- $(uname | tr ' [:upper:]' ' [:lower:]' )}
7+
8+ if [[ $( uname -m) == " x86_64" ]]; then
9+ HOST_ARCH=" amd64"
10+ else
11+ HOST_ARCH=${HOST_ARCH:- $(uname -m)}
12+ fi
13+
14+ ARTIFACT_NAME=${BINARY_NAME} -${HOST_OS} -${HOST_ARCH} .tar.gz
15+
16+ LATEST_RELEASE=$( curl -L -s -H ' Accept: application/json' https://github.com/hashnode/hashnode-cli/releases/latest)
17+ LATEST_VERSION=$( echo $LATEST_RELEASE | sed -e ' s/.*"tag_name":"\([^"]*\)".*/\1/' )
18+ ARTIFACT_URL=" https://github.com/hashnode/hashnode-cli/releases/download/$LATEST_VERSION /$ARTIFACT_NAME "
19+
20+ curl -L $ARTIFACT_URL | tar xvz
21+ sudo mv hashnode /usr/local/bin/hashnode
22+
23+ GREEN=' \033[0;32m'
24+ NC=' \033[0m'
25+
26+ echo -e " ${GREEN} Installed Successfully${NC} "
27+
You can’t perform that action at this time.
0 commit comments