Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1139] Fixed Code Spells #1140

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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/docker-outside-of-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Docker (docker-outside-of-docker) (docker-outside-of-docker)

Re-use the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.
Reuse the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.

## Example Usage

Expand Down
4 changes: 2 additions & 2 deletions src/docker-outside-of-docker/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "docker-outside-of-docker",
"version": "1.6.0",
"version": "1.6.1",
"name": "Docker (docker-outside-of-docker)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker",
"description": "Re-use the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.",
"description": "Reuse the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.",
"options": {
"version": {
"type": "string",
Expand Down
12 changes: 6 additions & 6 deletions src/java/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pkg_manager_update() {
set +e
stderr_messages=$(${PKG_MGR_CMD} -q check-update 2>&1)
rc=$?
# centos 7 sometimes returns a status of 100 when it apears to work.
# centos 7 sometimes returns a status of 100 when it appears to work.
if [ $rc != 0 ] && [ $rc != 100 ]; then
echo "(Error) ${PKG_MGR_CMD} check-update produced the following error message(s):"
echo "${stderr_messages}"
Expand Down Expand Up @@ -202,17 +202,17 @@ find_version_list() {
ifLts="$4"
version_list=$5
java_ver=$6

check_packages jq
all_versions=$(curl -s https://api.adoptium.net/v3/info/available_releases)
if [ "${ifLts}" = "true" ]; then
if [ "${ifLts}" = "true" ]; then
major_version=$(echo "$all_versions" | jq -r '.most_recent_lts')
elif [ "${java_ver}" = "latest" ]; then
major_version=$(echo "$all_versions" | jq -r '.most_recent_feature_release')
major_version=$(echo "$all_versions" | jq -r '.most_recent_feature_release')
else
major_version=$(echo "$java_ver" | cut -d '.' -f 1)
fi

if [ "${JDK_DISTRO}" = "ms" ]; then
if [ "${major_version}" = "8" ] || [ "${major_version}" = "18" ] || [ "${major_version}" = "22" ] || [ "${major_version}" = "23" ]; then
JDK_DISTRO="tem"
Expand Down Expand Up @@ -246,7 +246,7 @@ sdk_install() {
requested_version="$(echo "${version_list}" | head -n 1)"
elif echo "${requested_version}" | grep -oE "${full_version_check}" > /dev/null 2>&1; then
echo "${requested_version}"
else
else
find_version_list "$prefix" "$suffix" "$install_type" "false" version_list "${requested_version}"
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ]; then
requested_version="$(echo "${version_list}" | head -n 1)"
Expand Down
4 changes: 2 additions & 2 deletions src/node/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pkg_mgr_update() {
set +e
stderr_messages=$(${PKG_MGR_CMD} -q check-update 2>&1)
rc=$?
# centos 7 sometimes returns a status of 100 when it apears to work.
# centos 7 sometimes returns a status of 100 when it appears to work.
if [ $rc != 0 ] && [ $rc != 100 ]; then
echo "(Error) ${PKG_MGR_CMD} check-update produced the following error message(s):"
echo "${stderr_messages}"
Expand Down Expand Up @@ -199,7 +199,7 @@ find_version_from_git_tags() {

install_yarn() {
if [ "${ADJUSTED_ID}" = "debian" ] && [ "${INSTALL_YARN_USING_APT}" = "true" ]; then
# for backward compatiblity with existing devcontainer features, install yarn
# for backward compatibility with existing devcontainer features, install yarn
# via apt-get on Debian systems
if ! type yarn >/dev/null 2>&1; then
# Import key safely (new method rather than deprecated apt-key approach) and install
Expand Down
2 changes: 1 addition & 1 deletion src/powershell/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "powershell",
"version": "1.5.0",
"version": "1.5.1",
"name": "PowerShell",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/powershell",
"description": "Installs PowerShell along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
Expand Down
26 changes: 13 additions & 13 deletions src/powershell/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ find_version_from_git_tags() {
local repository=$2
local prefix=${3:-"tags/v"}
local separator=${4:-"."}
local last_part_optional=${5:-"false"}
local last_part_optional=${5:-"false"}
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
local escaped_separator=${separator//./\\.}
local last_part
Expand Down Expand Up @@ -93,7 +93,7 @@ install_using_apt() {
if [ "${POWERSHELL_VERSION}" = "latest" ] || [ "${POWERSHELL_VERSION}" = "lts" ] || [ "${POWERSHELL_VERSION}" = "stable" ]; then
# Empty, meaning grab whatever "latest" is in apt repo
version_suffix=""
else
else
version_suffix="=$(apt-cache madison powershell | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "^(${POWERSHELL_VERSION})(\.|$|\+.*|-.*)")"

if [ -z ${version_suffix} ] || [ ${version_suffix} = "=" ]; then
Expand Down Expand Up @@ -140,7 +140,7 @@ find_prev_version_from_git_tags() {
((breakfix=breakfix-1))
if [ "${breakfix}" = "0" ] && [ "${last_part_optional}" = "true" ]; then
declare -g ${variable_name}="${major}.${minor}"
else
else
declare -g ${variable_name}="${major}.${minor}.${breakfix}"
fi
fi
Expand All @@ -153,21 +153,21 @@ get_previous_version() {
local repo_url=$2
local variable_name=$3
prev_version=${!variable_name}

output=$(curl -s "$repo_url");
check_packages jq
message=$(echo "$output" | jq -r '.message')

if [[ $message == "API rate limit exceeded"* ]]; then
echo -e "\nAn attempt to find latest version using GitHub Api Failed... \nReason: ${message}"
echo -e "\nAttempting to find latest version using GitHub tags."
find_prev_version_from_git_tags prev_version "$url" "tags/v"
declare -g ${variable_name}="${prev_version}"
else
else
echo -e "\nAttempting to find latest version using GitHub Api."
version=$(echo "$output" | jq -r '.tag_name')
declare -g ${variable_name}="${version#v}"
fi
fi
echo "${variable_name}=${!variable_name}"
}

Expand Down Expand Up @@ -207,15 +207,15 @@ install_using_github() {
pwsh_url="https://github.com/PowerShell/PowerShell"
find_version_from_git_tags POWERSHELL_VERSION $pwsh_url
install_pwsh "${POWERSHELL_VERSION}"
if grep -q "Not Found" "${powershell_filename}"; then
if grep -q "Not Found" "${powershell_filename}"; then
install_prev_pwsh $pwsh_url
fi

# Ugly - but only way to get sha256 is to parse release HTML. Remove newlines and tags, then look for filename followed by 64 hex characters.
curl -sSL -o "release.html" "https://github.com/PowerShell/PowerShell/releases/tag/v${POWERSHELL_VERSION}"
powershell_archive_sha256="$(cat release.html | tr '\n' ' ' | sed 's|<[^>]*>||g' | grep -oP "${powershell_filename}\s+\K[0-9a-fA-F]{64}" || echo '')"
if [ -z "${powershell_archive_sha256}" ]; then
echo "(!) WARNING: Failed to retrieve SHA256 for archive. Skipping validaiton."
echo "(!) WARNING: Failed to retrieve SHA256 for archive. Skipping validation."
gvatsal60 marked this conversation as resolved.
Show resolved Hide resolved
else
echo "SHA256: ${powershell_archive_sha256}"
echo "${powershell_archive_sha256} *${powershell_filename}" | sha256sum -c -
Expand All @@ -230,7 +230,7 @@ install_using_github() {

if ! type pwsh >/dev/null 2>&1; then
export DEBIAN_FRONTEND=noninteractive

# Source /etc/os-release to get OS info
. /etc/os-release
architecture="$(dpkg --print-architecture)"
Expand All @@ -240,7 +240,7 @@ if ! type pwsh >/dev/null 2>&1; then
else
use_github="true"
fi

if [ "${use_github}" = "true" ]; then
echo "Attempting install from GitHub release..."
install_using_github
Expand All @@ -256,8 +256,8 @@ if [ ${#POWERSHELL_MODULES[@]} -gt 0 ]; then
for i in "${modules[@]}"
do
module_parts=(`echo ${i} | tr '==' ' '`)
module_name="${module_parts[0]}"
args="-Name ${module_name} -AllowClobber -Force -Scope AllUsers"
module_name="${module_parts[0]}"
args="-Name ${module_name} -AllowClobber -Force -Scope AllUsers"
if [ "${#module_parts[@]}" -eq 2 ]; then
module_version="${module_parts[1]}"
echo "Installing ${module_name} v${module_version}"
Expand Down
2 changes: 1 addition & 1 deletion src/python/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ install_python() {
fi
if [ ! -d "${current_bin_path}" ] ; then
mkdir -p "${current_bin_path}"
# Add an interpreter symlink but point it to "/usr" since python is at /usr/bin/python, add other alises
# Add an interpreter symlink but point it to "/usr" since python is at /usr/bin/python, add other aliases
ln -s "${INSTALL_PATH}/bin/python3" "${current_bin_path}/python3"
ln -s "${INSTALL_PATH}/bin/python3" "${current_bin_path}/python"
ln -s "${INSTALL_PATH}/bin/pydoc3" "${current_bin_path}/pydoc3"
Expand Down
2 changes: 1 addition & 1 deletion test/aws-cli/checkBashCompletion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo -e "Checking completion for command '$command'..."
# Also note the 'y' which responds to the possible Bash question "Display all xxx possibilities? (y or n)".
# Bash produces the autocompletion output on stderr, so redirect that to stdout.
# The sed bit captures the lines between Header and Footer (used as output delimiters).
# The first grep removes the "Display all" message (that is atomatically answered to "y" by the script).
# The first grep removes the "Display all" message (that is automatically answered to "y" by the script).
# The last grep filters the output to lines containing the expected result.
COMPLETE_OUTPUT=$(echo if false\; then "Header"\; $command$'\t'$'\t'y\; "Footer" fi | bash -i 2>&1 | sed -n '/Header/{:a;n;/Footer/q;p;ba}' | grep -v ^'Display all ')
echo -e "\nCompletion output:\n"
Expand Down
2 changes: 1 addition & 1 deletion test/kubectl-helm-minikube/checkBashCompletion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo -e "Checking completion for command '$command'..."
# Also note the 'y' which responds to the possible Bash question "Display all xxx possibilities? (y or n)".
# Bash produces the autocompletion output on stderr, so redirect that to stdout.
# The sed bit captures the lines between Header and Footer (used as output delimiters).
# The first grep removes the "Display all" message (that is atomatically answered to "y" by the script).
# The first grep removes the "Display all" message (that is automatically answered to "y" by the script).
# The last grep filters the output to lines containing the expected result.
COMPLETE_OUTPUT=$(echo if false\; then "Header"\; $command$'\t'$'\t'y\; "Footer" fi | bash -i 2>&1 | sed -n '/Header/{:a;n;/Footer/q;p;ba}' | grep -v ^'Display all ')
echo -e "\nCompletion output:\n"
Expand Down
16 changes: 8 additions & 8 deletions test/powershell/install_powershell_fallback_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ find_version_from_git_tags() {
local repository=$2
local prefix=${3:-"tags/v"}
local separator=${4:-"."}
local last_part_optional=${5:-"false"}
local last_part_optional=${5:-"false"}
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
local escaped_separator=${separator//./\\.}
local last_part
Expand Down Expand Up @@ -85,7 +85,7 @@ find_prev_version_from_git_tags() {
((breakfix=breakfix-1))
if [ "${breakfix}" = "0" ] && [ "${last_part_optional}" = "true" ]; then
declare -g ${variable_name}="${major}.${minor}"
else
else
declare -g ${variable_name}="${major}.${minor}.${breakfix}"
fi
fi
Expand All @@ -102,10 +102,10 @@ get_previous_version() {

output=$(curl -s "$repo_url");
message=$(echo "$output" | jq -r '.message')

if [ $mode == "mode1" ]; then
message="API rate limit exceeded"
else
else
message=""
fi

Expand All @@ -114,11 +114,11 @@ get_previous_version() {
echo -e "\nAttempting to find latest version using GitHub tags."
find_prev_version_from_git_tags prev_version "$url" "tags/v"
declare -g ${variable_name}="${prev_version}"
else
else
echo -e "\nAttempting to find latest version using GitHub Api."
version=$(echo "$output" | jq -r '.tag_name')
declare -g ${variable_name}="${version#v}"
fi
fi
echo "${variable_name}=${!variable_name}"
}

Expand Down Expand Up @@ -154,15 +154,15 @@ install_using_github() {
pwsh_url="https://github.com/PowerShell/PowerShell"
POWERSHELL_VERSION="7.4.xyz"
install_pwsh "${POWERSHELL_VERSION}"
if grep -q "Not Found" "${powershell_filename}"; then
if grep -q "Not Found" "${powershell_filename}"; then
install_prev_pwsh $pwsh_url $mode
fi

# Ugly - but only way to get sha256 is to parse release HTML. Remove newlines and tags, then look for filename followed by 64 hex characters.
sudo curl -sSL -o "release.html" "https://github.com/PowerShell/PowerShell/releases/tag/v${POWERSHELL_VERSION}"
powershell_archive_sha256="$(cat release.html | tr '\n' ' ' | sed 's|<[^>]*>||g' | grep -oP "${powershell_filename}\s+\K[0-9a-fA-F]{64}" || echo '')"
if [ -z "${powershell_archive_sha256}" ]; then
echo "(!) WARNING: Failed to retrieve SHA256 for archive. Skipping validaiton."
echo "(!) WARNING: Failed to retrieve SHA256 for archive. Skipping validation."
else
echo "SHA256: ${powershell_archive_sha256}"
echo "${powershell_archive_sha256} *${powershell_filename}" | sha256sum -c -
Expand Down