Skip to content

Commit 9429a40

Browse files
committed
Fix macos get.sh problem
1 parent 9adf13e commit 9429a40

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

get.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ set -eo pipefail
66
GREEN='\033[0;32m'
77
NC='\033[0m'
88
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
9+
INSTALL_PATH="/usr/local/bin"
1410

1511
if ! [ -x "$(command -v tar)" ]; then
1612
echo 'Error: curl is not installed.' >&2
1713
exit 1
1814
fi
1915

16+
# Check for root permission
17+
touch ${INSTALL_PATH}/.hashnode &> /dev/null || (echo -e "${RED}Root access is required to install to ${GREEEN}${INSTALL_PATH}${NC}" && exit 1)
18+
rm ${INSTALL_PATH}/.hashnode
19+
2020
BINARY_NAME="hashnode"
2121
HOST_OS=${HOST_OS:-$(uname | tr '[:upper:]' '[:lower:]')}
2222

0 commit comments

Comments
 (0)