summaryrefslogtreecommitdiff
path: root/share/spack/qa/update-completion-scripts.sh
blob: 8fcd32145768dd152022d4897478601cb46cd3a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
#
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

# Updates Spack's shell tab completion scripts

# Switch to parent directory
QA_DIR="$(dirname "${BASH_SOURCE[0]}")"
cd "$QA_DIR/.."

# Update each shell
for shell in bash # zsh fish
do
    header=$shell/spack-completion.in
    script=spack-completion.$shell

    rm -f $script
    spack commands --aliases --format=$shell --header=$header --update=$script
    chmod +x $script
done