Skip to content

Commit 610a7e3

Browse files
authored
Merge pull request #16 from github/post-install-cli
Install cli on onCreate.
2 parents dfaeeb6 + 617ad19 commit 610a7e3

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"openFiles": ["README.md"]
99
}
1010
},
11+
"onCreateCommand": "bash .devcontainer/onCreateCommand.sh",
1112
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh"
1213
}

.devcontainer/onCreateCommand.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Assumes the gh CLI is present in the default Codespaces image.
4+
gh extensions install github/gh-codeql
5+
gh codeql version # first command starts the download of the CodeQL CLI
6+
# Make codeql visible to VSCode by using https://github.com/github/gh-codeql#codeql-stub, since VS Code expects an executable called codeql instead of gh codeql
7+
gh codeql install-stub ~/.local/bin/

.devcontainer/postCreateCommand.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/bin/bash
22

3-
# Assumes the gh CLI is present in the default Codespaces image.
4-
# gh extensions install github/gh-codeql
5-
# gh codeql version # first command starts the download
6-
73
# Copy the dbscheme into the tutorial library, so it matches the DB.
84
cp .tours/codeql-tutorial-database/db-csv/csv.dbscheme tutorial-queries/
95
cp .tours/codeql-tutorial-database/db-csv/csv.dbscheme.stats tutorial-queries/

0 commit comments

Comments
 (0)