jason0x43 / hubitat

Hubitat apps and drivers
The Unlicense
58 stars 39 forks source link

Hubitat script should handle external scripts #1

Closed jason0x43 closed 6 years ago

jason0x43 commented 6 years ago

The hubitat script should provide some basic handling of external apps and drivers (ones I'm using as-is). For example, if I'm using the homebridge app from https://github.com/tonesto7/homebridge-hubitat-tonesto7, I would like to be able to run a habitat command to check for updates.

A simple way to handle this, for now at least, would be to expand the hubitat manifest format to support external scripts. Currently, app and driver entries look like:

{
  "filename": "namespace-myapp.groovy",
  "version": 4,
  "hash": "abcdef123459..."
}

The entry could be modified to support GitHub repo paths (assuming everything is on GH):

{
  "filename": "org/repo/path/to/myapp.groovy",
  "version": 4,
  "hash": "abcdef123459..."
}

The script would determine from the filename that the file was stored in an external repo vs locally. Pulling would no longer save these files anywhere; instead, hubitat would emit a warning if an externally managed file had been updated on the hubitat. Pushing would push from a local clone of the repo. The script file wouldn't be saved in this repo.

jason0x43 commented 6 years ago

Basic support for GitHub-hosted scripts was added in 4417a2731bdf48602cb0e8e90b10bff3aeaf0388