script-updates: allow to set dont-require-permissions=yes

This requires the new script to contain a line:

# requires: dont-require-permissions=yes
This commit is contained in:
Christian Hesse 2018-10-12 11:12:45 +02:00
parent 28df37708c
commit 4eba04b9c4

View file

@ -53,8 +53,11 @@
:if ([ :pick $sourcenew 0 5 ] = "#!rsc") do={ :if ([ :pick $sourcenew 0 5 ] = "#!rsc") do={
:local sourcecurrent [ / system script get $script source ]; :local sourcecurrent [ / system script get $script source ];
:if ($sourcenew != $sourcecurrent) do={ :if ($sourcenew != $sourcecurrent) do={
:local "dont-require-permissions" \
($sourcenew~"\n# requires: dont-require-permissions=yes\n");
:log info ("Updating script: " . $scriptname); :log info ("Updating script: " . $scriptname);
/ system script set owner=$scriptname source=$sourcenew $script; / system script set owner=$scriptname source=$sourcenew \
dont-require-permissions=$"dont-require-permissions" $script;
} else={ } else={
:log debug ("Script " . $scriptname . " did not change"); :log debug ("Script " . $scriptname . " did not change");
} }