File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22# set -x
33set -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
414
515if ! [ -x " $( command -v tar) " ]; then
616 echo ' Error: curl is not installed.' >&2
@@ -23,10 +33,8 @@ LATEST_VERSION=$(echo $LATEST_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/
2333ARTIFACT_URL=" https://github.com/hashnode/hashnode-cli/releases/download/$LATEST_VERSION /$ARTIFACT_NAME "
2434
2535curl -L $ARTIFACT_URL | tar xvz
26- sudo mv hashnode /usr/local/bin/hashnode
36+ mv hashnode /usr/local/bin/hashnode
2737
28- GREEN=' \033[0;32m'
29- NC=' \033[0m'
3038
3139echo -e " ${GREEN} Installed Successfully${NC} "
3240
You can’t perform that action at this time.
0 commit comments