Update JFrog CLI completion configuration to get the default shell

pull/115/head
Muhammad Atif Ali 2 years ago
parent 740b3fe9cd
commit e85607f18c

@ -102,8 +102,11 @@ fi
# Configure the JFrog CLI completion
echo "📦 Configuring JFrog CLI completion..."
SHELLNAME=$(basename $SHELL)
## Get the user's shell
SHELLNAME=$(grep "^$USER" /etc/passwd | awk -F':' '{print $7}' | awk -F'/' '{print $NF}')
## Generate the completion script
jf completion $SHELLNAME --install
## Add the completion script to the user's shell profile
if [ "$SHELLNAME" == "bash" ] || [ "$SHELLNAME" == "zsh" ]; then
if ! grep -q "source $HOME/.jfrog/jfrog_$${SHELLNAME}_completion" ~/.$${SHELLNAME}rc; then
echo "source $HOME/.jfrog/jfrog_$${SHELLNAME}_completion" >> ~/.$${SHELLNAME}rc

@ -102,8 +102,11 @@ fi
# Configure the JFrog CLI completion
echo "📦 Configuring JFrog CLI completion..."
SHELLNAME=$(basename $SHELL)
## Get the user's shell
SHELLNAME=$(grep "^$USER" /etc/passwd | awk -F':' '{print $7}' | awk -F'/' '{print $NF}')
## Generate the completion script
jf completion $SHELLNAME --install
## Add the completion script to the user's shell profile
if [ "$SHELLNAME" == "bash" ] || [ "$SHELLNAME" == "zsh" ]; then
if ! grep -q "source $HOME/.jfrog/jfrog_$${SHELLNAME}_completion" ~/.$${SHELLNAME}rc; then
echo "source $HOME/.jfrog/jfrog_$${SHELLNAME}_completion" >> ~/.$${SHELLNAME}rc

Loading…
Cancel
Save