1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-29 16:56:40 +03:00
vimr/bin/generate_sources.sh

40 lines
1.5 KiB
Bash
Raw Normal View History

2019-12-22 23:45:42 +03:00
#!/bin/bash
set -Eeuo pipefail
2022-06-26 19:28:01 +03:00
readonly clean=${clean:?"true or false"}
2019-12-22 23:45:42 +03:00
readonly use_committed_nvim=${use_committed_nvim:?"If true, checkout the committed version of nvim, otherwise use the workspace."}
2020-11-20 10:52:25 +03:00
main() {
echo "### Generating autocmds file."
echo "* use_committed_nvim=$use_committed_nvim"
pushd "$( dirname "${BASH_SOURCE[0]}" )/.." > /dev/null
if [[ "${use_committed_nvim}" == true ]]; then
echo "### Using the committed version of neovim."
git submodule update
else
echo "### Using the workspace neovim."
fi
pushd NvimServer > /dev/null
major=$(grep -e "set(NVIM_VERSION_MAJOR" CMakeLists.txt | gsed -E "s/.*([0-9]+).*/\1/")
minor=$(grep -e "set(NVIM_VERSION_MINOR" CMakeLists.txt | gsed -E "s/.*([0-9]+).*/\1/")
patch=$(grep -e "set(NVIM_VERSION_PATCH" CMakeLists.txt | gsed -E "s/.*([0-9]+).*/\1/")
prerelease=$(grep -e "set(NVIM_VERSION_PRERELEASE" CMakeLists.txt | gsed -E "s/.*\(.*\"(.*)\"\).*/\1/")
nvim_version="v$major.$minor.$patch$prerelease"
echo "### Using nvim version: $nvim_version"
./NvimServer/bin/build_libnvim.sh
popd > /dev/null
2020-12-20 17:53:11 +03:00
pushd NvimServer
version=${nvim_version} ../bin/generate_autocmds.py > "../NvimView/Sources/NvimView/NvimAutoCommandEvent.generated.swift"
version=${nvim_version} ../bin/generate_cursor_shape.py > "../NvimView/Sources/NvimView/NvimCursorModeShape.generated.swift"
2020-11-20 10:52:25 +03:00
popd > /dev/null
popd > /dev/null
echo "### Successfully generated autocmds."
}
main