Skip to content

Commit 1fe999a

Browse files
authored
Refactor devcontainer lifecycle commands
1 parent ce8e199 commit 1fe999a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.devcontainer/devcontainer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@
5959
},
6060

6161
// Lifecycle commands
62-
"onCreateCommand": [
62+
"onCreateCommand": "npm ci",
63+
"postStartCommand": "nohup bash -c 'npm start &'",
64+
// Set the port to be public
65+
"postAttachCommand": [
6366
"npm set \"//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN\"",
6467
"npm set \"@github:registry=https://npm.pkg.github.com/\"",
6568
"npm install -g @github/copilot",
66-
"npm ci"
69+
"gh cs ports visibility 4000:public -c \"$CODESPACE_NAME\""
6770
],
68-
"postStartCommand": "nohup bash -c 'npm start &'",
69-
// Set the port to be public
70-
"postAttachCommand": "gh cs ports visibility 4000:public -c \"$CODESPACE_NAME\"",
71-
71+
7272
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
7373
"remoteUser": "node",
7474

0 commit comments

Comments
 (0)