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/devtool/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "DevTool",
"id": "devtool",
"version": "1.0.1",
"version": "1.0.2",
"description": "Install DevTool",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
Expand Down
18 changes: 16 additions & 2 deletions src/devtool/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,33 @@ EOF
tee -a "$DEVTOOL_SCRIPT_PATH" > /dev/null \
<< 'EOF'

echo "Installing DevTool..."
echo "::step::Waiting for AzDO Authentication Helper..."
# Wait up to 3 minutes for the ado-auth-helper to be installed
for i in {1..180}; do
if [ -f ${HOME}/ado-auth-helper ]; then
break
fi
sleep 1
done

echo "::step::Installing DevTool..."
cd /tmp
curl -sL https://aka.ms/InstallToolLinux.sh | sh -s DevTool
EOF

chmod 755 "$DEVTOOL_SCRIPT_PATH"

# Setup PATH so that DevTool will be on PATH when the initial terminal is started
if command -v sudo >/dev/null 2>&1; then
if [ "root" != "$_REMOTE_USER" ]; then
echo "Adding DevTool to PATH for $_REMOTE_USER"
sudo -u ${_REMOTE_USER} bash -c 'echo "export PATH=\$PATH:$HOME/.config/DevTool/CurrentVersion" >> ~/.bashrc'
sudo -u ${_REMOTE_USER} bash -c 'echo "export PATH=\$PATH:$HOME/.config/DevTool/CurrentVersion" >> ~/.zshrc'
exit 0
fi
fi

echo "Adding DevTool to PATH for root"
echo "export PATH=\$PATH:/root/.config/DevTool/CurrentVersion" >> /etc/bash.bashrc || true
echo "export PATH=\$PATH:/root/.config/DevTool/CurrentVersion" >> /etc/zsh/zshrc || true

exit 0
3 changes: 1 addition & 2 deletions test/devtool/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ set -e
source dev-container-features-test-lib

# Feature-specific tests
check "devtool" cat /usr/local/share/install-devtool.sh

check "devtool" grep "DevTool" <(cat ~/.bashrc)

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down