2022-09-29 12:31:01 +00:00
|
|
|
{ writeShellScript
|
|
|
|
, lib
|
2023-01-27 01:40:06 +00:00
|
|
|
, curl
|
|
|
|
, jq
|
2022-09-29 12:31:01 +00:00
|
|
|
, git
|
2023-01-27 01:40:06 +00:00
|
|
|
, gnugrep
|
|
|
|
, gnused
|
2022-09-29 12:31:01 +00:00
|
|
|
, nix-update
|
|
|
|
}:
|
|
|
|
|
|
|
|
writeShellScript "update-esphome" ''
|
2023-01-27 01:40:06 +00:00
|
|
|
PATH=${lib.makeBinPath [ curl gnugrep gnused jq git nix-update ]}
|
2022-09-29 12:31:01 +00:00
|
|
|
|
2023-01-27 01:40:06 +00:00
|
|
|
LATEST=$(curl https://api.github.com/repos/esphome/esphome/releases/latest | jq -r '.name')
|
|
|
|
echo "Latest version: $LATEST"
|
|
|
|
|
|
|
|
DASHBOARD_VERSION=$(curl https://raw.githubusercontent.com/esphome/esphome/$LATEST/requirements.txt | \
|
|
|
|
grep "esphome-dashboard==" | sed "s/.*=//")
|
|
|
|
echo "Dashboard version: $DASHBOARD_VERSION"
|
|
|
|
|
|
|
|
nix-update esphome.dashboard --version $DASHBOARD_VERSION
|
|
|
|
nix-update esphome --version $LATEST
|
2022-09-29 12:31:01 +00:00
|
|
|
''
|