The shell completion scripts in "contrib/completion" are being tested, but none of our build systems support installing them. This is somewhat confusing for Meson, where users can explicitly enable building these scripts via `-Dcontrib=completion`. This option only controlls whether the completions are built and tested against, where "building" is a bit of an euphemism for "copying them into the build directory". Teach both our Makefile and Meson to install our Bash completion script. For now, this is the only completion script that we're installing given that Bash completions "just work" with a canonical well-known location nowadays. Other completion scripts, like for example the one for zsh, don't have a well-known location and/or require extra steps by the user to make them available. As such, we skip installing these scripts for now, but we may do so in the future if we ever figure out a proper way to do this. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
35 lines
928 B
Meson
35 lines
928 B
Meson
foreach script : [
|
|
'git-completion.bash',
|
|
'git-completion.tcsh',
|
|
'git-completion.zsh',
|
|
'git-prompt.sh'
|
|
]
|
|
if meson.version().version_compare('>=1.3.0')
|
|
test_dependencies += fs.copyfile(script)
|
|
else
|
|
configure_file(
|
|
input: script,
|
|
output: script,
|
|
copy: true,
|
|
)
|
|
endif
|
|
endforeach
|
|
|
|
# We have to discern between the test dependency and the installed file. Our
|
|
# tests assume the completion scripts to have the same name as the in-tree
|
|
# files, but the installed filenames need to match the executable's basename.
|
|
if meson.version().version_compare('>=1.3.0')
|
|
fs.copyfile('git-completion.bash', 'git',
|
|
install: true,
|
|
install_dir: get_option('datadir') / 'bash-completion/completions',
|
|
)
|
|
else
|
|
configure_file(
|
|
input: 'git-completion.bash',
|
|
output: 'git',
|
|
copy: true,
|
|
install: true,
|
|
install_dir: get_option('datadir') / 'bash-completion/completions',
|
|
)
|
|
endif
|