diff --git a/src/copilot-cli/devcontainer-feature.json b/src/copilot-cli/devcontainer-feature.json index ab433e2ae..08a92753c 100644 --- a/src/copilot-cli/devcontainer-feature.json +++ b/src/copilot-cli/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "copilot-cli", - "version": "1.0.0", + "version": "1.1.0", "name": "GitHub Copilot CLI", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/copilot-cli", "description": "Installs the GitHub Copilot CLI.", @@ -15,6 +15,7 @@ "description": "Select version of the GitHub Copilot CLI, if not latest." } }, + "postStartCommand": "[ -f /etc/devcontainer-copilot-cli/use-latest ] && copilot update || true", "customizations": { "vscode": { "settings": { diff --git a/src/copilot-cli/install.sh b/src/copilot-cli/install.sh index 7250fa642..b50f52ed2 100755 --- a/src/copilot-cli/install.sh +++ b/src/copilot-cli/install.sh @@ -80,3 +80,9 @@ echo "Downloading GitHub Copilot CLI..." install_using_github +# Create a flag file if using "latest" so the postStartCommand knows to auto-update +if [ "${CLI_VERSION}" = "latest" ]; then + mkdir -p /etc/devcontainer-copilot-cli + touch /etc/devcontainer-copilot-cli/use-latest +fi +