{
  "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;"
      ]
    }
  ]
}
