Skip to content

Commit

Permalink
bringing in brew completions from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
aussielunix committed Feb 2, 2024
1 parent e030478 commit 79adfac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ RUN cat /aussielunix_Root_CA_168848365996868199089383065266162030969.crt >> /etc
&& rm -f /aussielunix_Root_CA_168848365996868199089383065266162030969.crt

# Patch /usr/bin/entrypoint
RUN sed -i '349,489 s/^/#/' /usr/bin/entrypoint && \
sed -i '499,1355 s/^/#/' /usr/bin/entrypoint && \
sed -i '1357 s/^/#/' /usr/bin/entrypoint
RUN sed -i '/missing_packages=0/,/# Workaround for when sudo is missing,/ s/^/#/' /usr/bin/entrypoint && \
sed -i '/elif command -v apt-get/,/# Set SHELL to the install path inside the container/ s/^/#/' /usr/bin/entrypoint && \
sed -i '/# Set SHELL to the install path inside the container/a touch /.containersetupdone' /usr/bin/entrypoint

# Use and configure bash, retrieve bash-prexec
RUN curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o /tmp/bash-prexec && \
Expand Down
2 changes: 2 additions & 0 deletions files/etc/profile.d/00-bluefin-cli-brew-firstrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ if test "$(id -u)" -gt "0"; then
green=$'\033[32m'
bold=$'\033[1m'
normal=$'\033[0m'
HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew
export HOMEBREW_REPOSITORY
if test ! -f /etc/linuxbrew.firstrun; then
printf "\nMyToolbox First Run Setup\n\n"
printf "Setting up sudo for ${bold}${USER}${normal}...\t\t\t "
Expand Down
12 changes: 12 additions & 0 deletions files/etc/profile.d/bash_completion.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# shellcheck shell=sh disable=SC1091,SC2039,SC2166
# Check for interactive bash and that we haven't already been sourced.
if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then

# Check for recent enough version of bash.
if [ "${BASH_VERSINFO[0]}" -gt 4 ] ||
[ "${BASH_VERSINFO[0]}" -eq 4 -a "${BASH_VERSINFO[1]}" -ge 2 ]; then
Expand All @@ -14,5 +15,16 @@ if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO
# Source completion code.
. /usr/local/share/bash-completion/bash_completion
fi
if ! test -L /home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew; then
/home/linuxbrew/.linuxbrew/bin/brew completions link
fi
if test -d /home/linuxbrew/.linuxbrew/etc/bash_completion.d; then
for rc in /home/linuxbrew/.linuxbrew/etc/bash_completion.d/*; do
if test -r "$rc"; then
. "$rc"
fi
done
unset rc
fi
fi
fi

0 comments on commit 79adfac

Please sign in to comment.