Skip to content

Commit

Permalink
improvements to install script
Browse files Browse the repository at this point in the history
  • Loading branch information
imclerran committed Jun 4, 2024
1 parent 83f6e52 commit b763a84
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/install
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@ MAGENTA="\033[35m"
CYAN="\033[36m"
RESET="\033[0m"

# Check if $LOCAL_BIN exists and create it if it does not
[ ! -d "$LOCAL_BIN" ] && mkdir -p "$LOCAL_BIN"

# Notify user that roc-start build process is starting
echo -e "Building ${MAGENTA}roc-start${RESET}...\n"
roc build --output roc-start --optimize > /dev/null 2>&1

# If build succeeds, copy the executable to $LOCAL_BIN and notify user
if [ $? -eq 0 ]; then
cp ./roc-start $LOCAL_BIN
echo -e "${MAGENTA}roc-start${RESET} installed to $LOCAL_BIN"
fi

# Check if the GitHub CLI (gh) is installed
if ! command -v gh > /dev/null 2>&1; then
echo -e "${YELLOW}- NOTE: ${MAGENTA}roc-start${RESET} requires ${CYAN}gh${RESET} to be installed. Please install the GitHub CLI: https://cli.github.com"
exit 1
fi
fi

# Check if $LOCAL_BIN is in the PATH
if [[ ":$PATH:" != *":$LOCAL_BIN:"* ]]; then
echo -e "${YELLOW}- NOTE:${RESET} $LOCAL_BIN is not in your PATH. Please make sure to add it to your shell's configuration file (e.g. ~/.zshrc, ~/.bashrc, etc.)"
fi

0 comments on commit b763a84

Please sign in to comment.