diff --git a/dev-python/typer/typer-0.12.1.ebuild b/dev-python/typer/typer-0.12.1.ebuild index fcb774a..7c3cb2e 100644 --- a/dev-python/typer/typer-0.12.1.ebuild +++ b/dev-python/typer/typer-0.12.1.ebuild @@ -36,6 +36,8 @@ RDEPEND=" ') " +COMPLETIONSDIR="${WORKDIR}/comp" + distutils_enable_tests pytest src_test() { @@ -45,11 +47,22 @@ src_test() { distutils-r1_src_test "${@}" } +src_compile() { + distutils-r1_src_compile "${@}" + + mkdir "${COMPLETIONSDIR}" + + export _TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION=1 + python -m typer --show-completion bash > "${COMPLETIONSDIR}/${PN}" + python -m typer --show-completion zsh > "${COMPLETIONSDIR}/_${PN}" + python -m typer --show-completion fish > "${COMPLETIONSDIR}/${PN}.fish" +} + src_install() { distutils-r1_src_install "${@}" export _TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION=1 - newzshcomp <(python -m typer --show-completion zsh) "_${PN}" - newfishcomp <(python -m typer --show-completion fish) "${PN}.fish" - newbashcomp <(python -m typer --show-completion bash) "${PN}" + dobashcomp "${COMPLETIONSDIR}/${PN}" + dozshcomp "${COMPLETIONSDIR}/_${PN}" + dofishcomp "${COMPLETIONSDIR}/${PN}.fish" }