Move scripts to own folder
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
SRC_DIR="${HOME}/apps/neovim"
|
||||
BIN_DIR="${HOME}/.local"
|
||||
BUILD_TYPE="Debug"
|
||||
BRANCH="master"
|
||||
|
||||
if [[ -x "${BIN_DIR}/bin/nvim" ]]; then
|
||||
echo "Neovim already installed at ${BIN_DIR}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Installing neovim from source"
|
||||
echo "Target folder: ${SRC_DIR}"
|
||||
echo "Branch: ${BRANCH}"
|
||||
echo "Build type: ${BUILD_TYPE}"
|
||||
|
||||
{{ if eq .chezmoi.osRelease.idLike "arch" }}
|
||||
sudo pacman -S --noconfirm --needed base-devel cmake ninja curl git
|
||||
{{ end }}
|
||||
|
||||
mkdir -p "${HOME}/apps"
|
||||
|
||||
if [[ -d "${SRC_DIR}/src" ]]; then
|
||||
cd "${SRC_DIR}/src"
|
||||
git fetch --all --prune
|
||||
git checkout "${BRANCH}"
|
||||
git pull
|
||||
else
|
||||
git clone https://github.com/neovim/neovim.git "${SRC_DIR}/src"
|
||||
cd "${SRC_DIR}/src"
|
||||
git checkout "${BRANCH}"
|
||||
fi
|
||||
|
||||
rm -rf ${SRC_DIR}/build
|
||||
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${BIN_DIR}"
|
||||
make install
|
||||
Reference in New Issue
Block a user