Skip to content

Commit

Permalink
fix: Tanzu init
Browse files Browse the repository at this point in the history
  • Loading branch information
MAHDTech committed Jul 18, 2023
1 parent c7deb34 commit a892414
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions nix/oci/tanzu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -215,43 +215,8 @@ in
cat << 'EOF' > /home/${containerUser}/.bashrc
#!/usr/bin/env bash
# Enable bash-completion
if shopt -q progcomp &>/dev/null;
then
BASH_COMPLETION_ENABLED="TRUE"
. "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
fi
# shellcheck disable=SC1090
source <(/bin/starship init bash --print-full-init)
# Binaries with bash completions
declare -r BINS=(
clusterctl
helm
imgpkg
kapp
kctrl
kubectl
kustomize
tanzu
ytt
)
if [[ "''${BASH_COMPLETION_ENABLED:-FALSE}" == "TRUE" ]];
then
echo "Loading bash completions into current shell..."
for BIN in "''${BINS[@]}";
do
echo "Loading bash completion for ''${BIN}"
source <(''${BIN} completion bash) || {
echo "Failed to source bash completion for ''${BIN}, skipping."
}
done
fi
# Initialise the Tanzu CLI
if [[ -f "''${HOME}/.config/tanzu/config.yaml" ]];
if [[ -d "''${HOME}/.config/tanzu/tkg" ]];
then
echo "Tanzu CLI is already initialised."
Expand Down Expand Up @@ -289,6 +254,41 @@ in
fi
# Enable bash-completion
if shopt -q progcomp &>/dev/null;
then
BASH_COMPLETION_ENABLED="TRUE"
. "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
fi
# shellcheck disable=SC1090
source <(/bin/starship init bash --print-full-init)
# Binaries with bash completions
declare -r BINS=(
clusterctl
helm
imgpkg
kapp
kctrl
kubectl
kustomize
tanzu
ytt
)
if [[ "''${BASH_COMPLETION_ENABLED:-FALSE}" == "TRUE" ]];
then
echo "Loading bash completions into current shell..."
for BIN in "''${BINS[@]}";
do
echo "Loading bash completion for ''${BIN}"
source <(''${BIN} completion bash) || {
echo "Failed to source bash completion for ''${BIN}, skipping."
}
done
fi
figlet "Tanzu CLI"
EOF
Expand Down

0 comments on commit a892414

Please sign in to comment.