From ef2cb11665cb2c855437606fe3b1a3c18310807c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 2 Jul 2020 00:03:21 +0200 Subject: global-functions: $ScriptInstallUpdate: get base url and suffix from comment Just set 'base-url=https://example.com/...' and/or 'url-suffix=\h=branch' in comment to overwrite settings from global configuration. --- global-functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/global-functions b/global-functions index f31136f..e01d807 100644 --- a/global-functions +++ b/global-functions @@ -527,9 +527,13 @@ :if ($Ignore = 0) do={ $LogPrintExit debug ("Fetching script from url: " . $ScriptVal->"name") false; :do { + :local BaseUrl $ScriptUpdatesBaseUrl; + :local UrlSuffix $ScriptUpdatesUrlSuffix; + :if ([ :typeof ($Comment->"base-url") ] = "str") do={ :set BaseUrl ($Comment->"base-url"); } + :if ([ :typeof ($Comment->"url-suffix") ] = "str") do={ :set UrlSuffix ($Comment->"url-suffix"); } + :local Result [ / tool fetch check-certificate=yes-without-crl \ - ($ScriptUpdatesBaseUrl . $ScriptVal->"name" . $ScriptUpdatesUrlSuffix) \ - output=user as-value ]; + ($BaseUrl . $ScriptVal->"name" . $UrlSuffix) output=user as-value ]; :if ($Result->"status" = "finished") do={ :set SourceNew ($Result->"data"); } -- cgit v1.2.3-54-g00ecf