From b9ed1eaf1d55d797091ac37272b3e03d03e1807d Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Tue, 22 Oct 2024 16:46:33 +0100 Subject: [PATCH] Added a check to the zsh completions generation step Ensuring that zsh is actually supported Signed-off-by: Eric Curtin --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 878e9846..0c4c3806 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,13 @@ completions: mkdir -p completions/fish/vendor_completions.d register-python-argcomplete --shell fish ramalama > completions/fish/vendor_completions.d/ramalama.fish - mkdir -p completions/zsh/vendor-completions - register-python-argcomplete --shell zsh ramalama > completions/zsh/vendor-completions/_ramalama + tmpfile=$$(mktemp); \ + if ! register-python-argcomplete --shell zsh ramalama > $${tmpfile}; then \ + mkdir -p completions/zsh/vendor-completions; \ + mv $${tmpfile} completions/zsh/vendor-completions/_ramalama; \ + else \ + rm $${tmpfile}; \ + fi .PHONY: install install: docs completions