1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00
vimr/bin/build_nvimserver.sh

47 lines
1.3 KiB
Bash
Raw Normal View History

2023-11-24 23:28:20 +03:00
#!/bin/bash
set -Eeuo pipefail
declare -r -x clean=${clean:-false}
2023-12-10 22:36:50 +03:00
declare -r -x for_dev=${for_dev:-false}
2023-11-24 23:28:20 +03:00
main() {
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
resources_folder="./NvimView/Sources/NvimView/Resources"
rm -rf "${resources_folder}/NvimServer"
rm -rf "${resources_folder}/runtime"
2023-12-10 22:36:50 +03:00
if [[ "${clean}" == true ]]; then
pushd ./Neovim >/dev/null
rm -rf .deps
rm -rf build
make distclean
popd >/dev/null
fi
if [[ "${for_dev}" == true ]]; then
pushd ./Neovim >/dev/null
mkdir -p ./build/install
make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=./install"
make install
2023-12-10 22:36:50 +03:00
popd >/dev/null
cp ./Neovim/build/install/bin/nvim "${resources_folder}/NvimServer"
cp -r ./Neovim/build/install/share/nvim/runtime "${resources_folder}"
2023-12-10 22:36:50 +03:00
else
./bin/neovim/bin/build_neovim.sh
pushd ./Neovim/build >/dev/null
tar -xf nvim-macos.tar.gz
popd >/dev/null
cp ./Neovim/build/nvim-macos/bin/nvim "${resources_folder}/NvimServer"
cp -r ./Neovim/build/nvim-macos/share/nvim/runtime "${resources_folder}"
fi
2023-11-24 23:28:20 +03:00
# Copy VimR specific vim file to runtime/plugin folder
cp "${resources_folder}/com.qvacua.NvimView.vim" "${resources_folder}/runtime/plugin"
popd >/dev/null
}
main