Skip to content

Commit

Permalink
chore(devcontainer): Automatically run tasks on debug
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider authored and jlsjonas committed Jan 22, 2022
1 parent 0d22b3b commit 64997db
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "Mini Graph Card Development",
"image": "ghcr.io/ludeeus/devcontainer/generic:latest",
"context": "..",
// "remoteUser": "vscode",
"remoteUser": "vscode",
"appPort": [
"8123:8123",
"5000:5000",
],
"postCreateCommand": "npm install && container install",
"postCreateCommand": "npm install && sudo container install",
"extensions": [
"github.vscode-pull-request-github",
"eamodio.gitlens",
Expand Down
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"name": "Launch Chrome against localhost",
"url": "http://localhost:8123",
"webRoot": "${workspaceFolder}/dist",
"sourceMaps": true
"sourceMaps": true,
"preLaunchTask": "debug",
"postDebugTask": "devcontainer: stop debug"
}
]
}
76 changes: 76 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"group": "test",
"label": "npm: watch",
"detail": "rollup -c --watch",
"isBackground": true,
"problemMatcher": {
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "^bundles\\s",
"endsPattern": "^.*waiting for changes\\.\\.\\."
}
}
},
{
"type": "shell",
"label": "devcontainer: Start HA",
"command": "sh -c 'sudo --preserve-env=PATH container start'",
"problemMatcher": {
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": "^Start Home Assistant$"
}
},
"group": "test",
"isBackground": true
},
{
"label": "debug",
"group": "test",
"dependsOn": [
"devcontainer: Start HA",
"npm: watch"
],
"problemMatcher": []
},
{
"label": "devcontainer: stop debug",
"group": "test",
"command": "sh",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"args": [
"-c",
"sudo killall hass; sudo kill $(ps au | grep 'node.*rollup' | grep -v grep | awk {'print $2'}); exit 0;",
]
}
]
}

0 comments on commit 64997db

Please sign in to comment.