capsman-download-packages: create package path

This commit is contained in:
Christian Hesse 2020-04-06 11:51:33 +02:00
parent 289fd215c4
commit 2cd8a56aa7

View file

@ -8,6 +8,8 @@
:global CleanFilePath;
:global DownloadPackage;
:global LogPrintExit;
:global MkDir;
:global ScriptLock;
$ScriptLock "capsman-download-packages";
@ -16,6 +18,12 @@ $ScriptLock "capsman-download-packages";
:local InstalledVersion [ / system package update get installed-version ];
:local Updated false;
:if ([ / file print count-only where name=$PackagePath type="directory" ] = 0) do={
$MkDir $PackagePath;
$LogPrintExit info ("Created directory at package path (" . $PackagePath . \
"). Please place your packages!") false;
}
:foreach Package in=[ / file find where type=package \
package-version!=$InstalledVersion name~("^" . $PackagePath) ] do={
:local File [ / file get $Package ];