We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9adf13e + 9429a40 commit 92dc1e7Copy full SHA for 92dc1e7
get.sh
@@ -6,17 +6,17 @@ set -eo pipefail
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
+INSTALL_PATH="/usr/local/bin"
14
15
if ! [ -x "$(command -v tar)" ]; then
16
echo 'Error: curl is not installed.' >&2
17
exit 1
18
fi
19
+# Check for root permission
+touch ${INSTALL_PATH}/.hashnode &> /dev/null || (echo -e "${RED}Root access is required to install to ${GREEEN}${INSTALL_PATH}${NC}" && exit 1)
+rm ${INSTALL_PATH}/.hashnode
+
20
BINARY_NAME="hashnode"
21
HOST_OS=${HOST_OS:-$(uname | tr '[:upper:]' '[:lower:]')}
22
0 commit comments