Skip to content

Commit

Permalink
aider: Fix build for mcr.microsoft.com/devcontainers/base:ubuntu 🤞
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy committed Dec 19, 2024
1 parent cd9c3a4 commit 56b0f03
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/aider/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,20 @@ main() {
fi

detect_username

if [ "$AIDER_VERSION" = latest ]; then
echo "Installing latest Aider..."
su -c 'pipx install aider-chat' "$USERNAME"
# NOTE(ivy): PS1=true works around an edge case where pipx isn't added
# to the PATH. This happens with the `mcr.microsoft.com/devcontainers/base:ubuntu`
# image which includes a check at the top of /etc/bash.bashrc which
# returns in non-interactive shells.
su - "$USERNAME" bash -c "PS1=true; . /etc/bash.bashrc || true; pipx install aider-chat"
else
echo "Installing Aider version $AIDER_VERSION..."
su -c "pipx install aider-chat==${AIDER_VERSION}" "$USERNAME"
# NOTE(ivy): PS1=true works around an edge case where pipx isn't added
# to the PATH. This happens with the `mcr.microsoft.com/devcontainers/base:ubuntu`
# image which includes a check at the top of /etc/bash.bashrc which
# returns in non-interactive shells.
su - "$USERNAME" bash -c "PS1=true; . /etc/bash.bashrc || true; pipx install aider-chat==${AIDER_VERSION}"
fi

echo "Aider has been installed!"
Expand Down

0 comments on commit 56b0f03

Please sign in to comment.