Skip to content

Commit

Permalink
install copilot CLI in devcontainer and dont show canUndo for START_GAME
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaMulein committed Oct 16, 2024
1 parent 60a06f0 commit ed1de1c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./setup-nvm.sh && yarn install && ./install-globals.sh"
"postCreateCommand": "./setup-nvm.sh && yarn install && ./install-globals.sh && ./install-copilot-cli.sh"

// Configure tool-specific properties.
// "customizations": {},
Expand Down
11 changes: 11 additions & 0 deletions install-copilot-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y

echo "GitHub CoPilot CLI is installed"
echo "Don't forget to run 'gh auth login'"
8 changes: 8 additions & 0 deletions src/game/dominion-lib-undo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ export function canUndoAction(game: IGame, logIndex: number): boolean {

const actionToUndo = game.log[logIndex];

// none of the No Player actions except Next Turn can be undone (start game, etc)
if (
NoPlayerActions.includes(actionToUndo.action) &&
actionToUndo.action !== GameLogActionWithCount.NEXT_TURN
) {
return false;
}

// Find the main action if this is a linked action
let mainActionIndex = logIndex;
if (actionToUndo.linkedAction !== undefined) {
Expand Down

0 comments on commit ed1de1c

Please sign in to comment.