Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aws-cli/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "aws-cli",
"version": "1.1.3",
"version": "1.1.4",
"name": "AWS CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/aws-cli",
"description": "Installs the AWS CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
Expand Down
12 changes: 5 additions & 7 deletions src/aws-cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,14 @@ install() {

./aws/install

# kubectl bash completion
# AWS bash completion
mkdir -p /etc/bash_completion.d
cp ./scripts/vendor/aws_bash_completer /etc/bash_completion.d/aws

# kubectl zsh completion
if [ -e "${USERHOME}/.oh-my-zsh" ]; then
mkdir -p "${USERHOME}/.oh-my-zsh/completions"
cp ./scripts/vendor/aws_zsh_completer.sh "${USERHOME}/.oh-my-zsh/completions/_aws"
chown -R "${USERNAME}" "${USERHOME}/.oh-my-zsh"
fi
# AWS zsh completion
mkdir -p /usr/local/share/zsh/site-functions/
cp ./scripts/vendor/aws_zsh_completer.sh /usr/local/share/zsh/site-functions/_aws
sed -i '1s/^/#compdef aws\n/' /usr/local/share/zsh/site-functions/_aws

rm -rf ./aws
}
Expand Down
9 changes: 9 additions & 0 deletions test/aws-cli/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@
"features": {
"aws-cli": {}
}
},
"zsh_completion": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"common-utils": {
"installZsh": true
},
"aws-cli": {}
}
}
}
17 changes: 17 additions & 0 deletions test/aws-cli/zsh_completion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e

# Import test library for `check` command
source dev-container-features-test-lib

# Check that the zsh completion file exists in the correct location
check "zsh completion file installed" test -f /usr/local/share/zsh/site-functions/_aws

# Check that the completion file has the proper zsh completion header
check "zsh completion file has compdef header" grep -q "^#compdef aws" /usr/local/share/zsh/site-functions/_aws

# Actual ZSH completion testing is a pain, so just ignoring it for now.

# Report result
reportResults
Loading