Skip to content

Commit

Permalink
install script fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
erhickey committed Feb 26, 2024
1 parent b5f9b48 commit 57e3e38
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

NPM_BIN=$(which npm)
if [[ ! -x "$NPM_BIN" ]]; then
echo "npm is not installed - aborting install"
exit 1
fi

GO_BIN=$(which go)
MAKE_BIN=$(which make)
if [[ -x "$GO_BIN" && -x "${MAKE_BIN}" ]]; then
Expand Down Expand Up @@ -30,9 +36,18 @@ ARCH=$(uname -m)
echo "Detected OS: $IS_MACOS $IS_LINUX $ARCH"
if [[ -n "$IS_MACOS" || -n "$IS_LINUX" ]] ; then
echo "Downloading binary for tag $TAG"
URL="https://github.com/napisani/nvim-dadbod-bg/releases/download/${TAG}/nvim-dadbod-bg_Darwin_${ARCH}"
OS="$([[ -n "$IS_MACOS" ]] && printf Darwin || printf Linux)"
URL="https://github.com/napisani/nvim-dadbod-bg/releases/download/${TAG}/nvim-dadbod-bg_${OS}_${ARCH}"
curl -L -o nvim-dadbod-bg "$URL"
chmod +x nvim-dadbod-bg
echo "Building web app"
if [[ -x "$MAKE_BIN" ]]; then
"$MAKE_BIN" buildweb
else
cd web || exit 2
"$NPM_BIN" ci
"$NPM_BIN" run build
fi
else
echo "Unsupported OS"
exit 1
Expand Down

0 comments on commit 57e3e38

Please sign in to comment.