Skip to content

Commit b9d8ef3

Browse files
authored
Merge pull request #3 from cmbrose/copilot/update-poststartcommand-auto-install
Conditionally run `copilot update` in postStartCommand only for `latest` version
2 parents 71ecdcb + bcaf3ce commit b9d8ef3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/copilot-cli/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"description": "Select version of the GitHub Copilot CLI, if not latest."
1616
}
1717
},
18-
"postStartCommand": "copilot update",
18+
"postStartCommand": "[ -f /etc/devcontainer-copilot-cli/use-latest ] && copilot update || true",
1919
"customizations": {
2020
"vscode": {
2121
"settings": {

src/copilot-cli/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,9 @@ echo "Downloading GitHub Copilot CLI..."
8080

8181
install_using_github
8282

83+
# Create a flag file if using "latest" so the postStartCommand knows to auto-update
84+
if [ "${CLI_VERSION}" = "latest" ]; then
85+
mkdir -p /etc/devcontainer-copilot-cli
86+
touch /etc/devcontainer-copilot-cli/use-latest
87+
fi
88+

0 commit comments

Comments
 (0)