diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2023-02-25 17:24:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-25 17:24:43 +0100 |
commit | db32d312acd4bee96b3463ff85a6574b5180502d (patch) | |
tree | ae8e22d079bd9b0929b455908acc51726c5a510a /scripts/gen_vimdoc.py | |
parent | 2708507e877f3255076bab2f5f074667dd25f8fc (diff) | |
download | rneovim-db32d312acd4bee96b3463ff85a6574b5180502d.tar.gz rneovim-db32d312acd4bee96b3463ff85a6574b5180502d.tar.bz2 rneovim-db32d312acd4bee96b3463ff85a6574b5180502d.zip |
ci(fix): repair regen-api-docs (#22403)
https://github.com/neovim/neovim/pull/22398 broke the job because there
is no `build/bin/nvim`
This keeps the preference for `build/bin/nvim` but adds back `nvim` as
fallback if it doesn't exist.
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-x | scripts/gen_vimdoc.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index b8c36dc35d..dd593475e2 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -62,11 +62,21 @@ if doxygen_version < MIN_DOXYGEN_VERSION: sys.exit(1) -# Need a `nvim` that supports `-l`, so use the local build -nvim = Path(__file__).parent / "../build/bin/nvim" -if not nvim.exists(): - print("\nYou need to build Neovim first to build the documentation.") - sys.exit(1) +# Need a `nvim` that supports `-l`, try the local build +nvim_path = Path(__file__).parent / "../build/bin/nvim" +if nvim_path.exists(): + nvim = str(nvim_path) +else: + # Until 0.9 is released, use this hacky way to check that "nvim -l foo.lua" works. + nvim_out = subprocess.check_output(['nvim', '-h'], universal_newlines=True) + nvim_version = [line for line in nvim_out.split('\n') + if '-l ' in line] + if len(nvim_version) == 0: + print(( + "\nYou need to have a local Neovim build or a `nvim` version 0.9 for `-l` " + "support to build the documentation.")) + sys.exit(1) + nvim = 'nvim' # DEBUG = ('DEBUG' in os.environ) |