nixpkgs/pkgs/applications/editors/vim/plugins/neovim-require-check-hook.sh
Matthieu Coudron cf53c81a2d vimUtils.neovimRequireCheckHook: fix hook by adding plugin dependencies to rtp
else neovim was not able to find the dependencies
2024-03-19 21:51:52 +01:00

22 lines
632 B
Bash

# Setup hook for checking whether Python imports succeed
echo "Sourcing neovim-require-check-hook.sh"
neovimRequireCheckHook () {
echo "Executing neovimRequireCheckHook"
if [ -n "$nvimRequireCheck" ]; then
echo "Check whether the following module can be imported: $nvimRequireCheck"
# editorconfig-checker-disable
export HOME="$TMPDIR"
@nvimBinary@ -es --headless -n -u NONE -i NONE --clean -V1 \
--cmd "set rtp+=$out,${dependencies/ /,}" \
--cmd "lua require('$nvimRequireCheck')"
fi
}
echo "Using neovimRequireCheckHook"
preDistPhases+=" neovimRequireCheckHook"