aboutsummaryrefslogtreecommitdiffstats
path: root/updates
diff options
context:
space:
mode:
Diffstat (limited to 'updates')
-rw-r--r--updates/default.nix18
-rw-r--r--updates/web/chromium/extensions.nix5
2 files changed, 19 insertions, 4 deletions
diff --git a/updates/default.nix b/updates/default.nix
new file mode 100644
index 0000000..2cf2894
--- /dev/null
+++ b/updates/default.nix
@@ -0,0 +1,18 @@
+{ pkgs, lib, ... }:
+
+let
+ chromiumExtensions = (import ./web/chromium/extensions.nix { inherit pkgs lib; }).mkUpdateScript;
+in
+pkgs.writeShellApplication {
+ name = "updates";
+ runtimeInputs = [ chromiumExtensions ];
+ text = ''
+ echo "Running all update checks..."
+ echo ""
+
+ check-chromium-extension-updates
+
+ echo ""
+ echo "All update checks complete."
+ '';
+}
diff --git a/updates/web/chromium/extensions.nix b/updates/web/chromium/extensions.nix
index 0d44652..d9de16d 100644
--- a/updates/web/chromium/extensions.nix
+++ b/updates/web/chromium/extensions.nix
@@ -24,8 +24,6 @@ in
"https://api.github.com/repos/${ext.owner}/${ext.repo}/tags"
else
"https://api.github.com/repos/${ext.owner}/${ext.repo}/releases/latest";
-
- # jq filter: grab the newest tag name from the tags array, or the tag_name from the release object
jqFilter = if isTag then ".[0].name" else ".tag_name";
in
''
@@ -35,9 +33,8 @@ in
if [ -z "$LATEST_RAW" ] || [ "$LATEST_RAW" == "null" ]; then
echo "FAIL [${ext.pname}] Failed to fetch data from GitHub API."
else
- # Strip prefix if one is specified
PREFIX="${ext.tagPrefix}"
- LATEST_STRIPPED="''${LATEST_RAW#$PREFIX}"
+ LATEST_STRIPPED="''${LATEST_RAW#"$PREFIX"}"
if [ "$LATEST_STRIPPED" != "${ext.version}" ]; then
echo "UPDATE [${ext.pname}] ${ext.version} -> $LATEST_STRIPPED"