aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-07-02 00:03:21 +0200
committerGravatar Christian Hesse <mail@eworm.de>2020-07-02 00:58:06 +0200
commitef2cb11665cb2c855437606fe3b1a3c18310807c (patch)
tree5c48c9fdda4ccf3d4b1eaf90b5feaca9229a6234
parente38f3fb022a0588fff1fab66d68cbf7cba0be693 (diff)
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.
-rw-r--r--global-functions8
1 files 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");
}