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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ to assist teams in adopting Codespaces. Here is a list of the features in this r
| Feature | Description |
| ------- | ----------- |
| [artifacts-helper](src/artifacts-helper) | Install Azure Artifacts credential helper configured for Codespace authentication |
| [devtool](src/devtool) | Installs DevTool (Microsoft-internal only) |
| [docfx](src/docfx) | Install docfx to support editing and testing documentation |
| [external-repository](src/external-repository) | Handles all the details of working with an external git repository in Codespaces |
| [microsoft-git](src/microsoft-git) | Install microsoft/git with Scalar and GVFS support |
Expand Down
7 changes: 7 additions & 0 deletions src/devtool/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This installs a Microsoft-internal tool named DevTool. This will also install
the `xdg-utils` package so that the `xdg-open` CLI is available for the
DevTool CLI to be able to use to open a web browser.

## OS Support

This feature is tested to work on Debian/Ubuntu
17 changes: 17 additions & 0 deletions src/devtool/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "DevTool",
"id": "devtool",
"version": "1.0.0",
"description": "Install DevTool",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
],
"customizations": {
"vscode": {
"extensions": [
"ms-codespaces-tools.ado-codespaces-auth"
]
}
},
"postCreateCommand": "curl –sL https://aka.ms/InstallToolLinux.sh | sh -s DevTool​"
}
40 changes: 40 additions & 0 deletions src/devtool/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

set -e


# Source /etc/os-release to get OS info
. /etc/os-release

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

apt_get_update()
{
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
}

# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
apt_get_update
apt-get -y install --no-install-recommends "$@"
rm -rf /var/lib/apt/lists/*
fi
}

export DEBIAN_FRONTEND=noninteractive

if [ "${ID}" = "mariner" ]; then
tdnf install -y curl ca-certificates
tdnf clean all
else
check_packages curl ca-certificates xdg-utils
fi

exit 0