Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Mar 20, 2024
1 parent 93065b6 commit 6d903f7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions plib/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public function indexAction()
Modules_Microweber_Helper::checkAndFixSchedulerTasks();
}


$task = new Modules_Microweber_Task_AppDownload();
$task->run();
echo 1;
die();
$this->_checkAppSettingsIsCorrect();

$this->view->errorMessage = false;
Expand Down
8 changes: 7 additions & 1 deletion plib/library/Task/AppDownload.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ public function run()

$appSharedPath = Modules_Microweber_Config::getAppSharedPath();

$downloadLog .= pm_ApiCli::callSbin('unzip_app_version.sh', [base64_encode($release['url']), $appSharedPath])['stdout'];
$downloadLog .= pm_ApiCli::callSbin('download_file.sh', [
base64_encode($release['url']),
$appSharedPath,
'microweber-app.zip'
])['stdout'];

die($downloadLog);

$this->updateProgress(50);

Expand Down
15 changes: 8 additions & 7 deletions sbin/download_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

downloadUrl=$(echo "$1" | base64 -d)

latestFolder=$2
if [ ! -d "$latestFolder" ]; then
mkdir -p "$latestFolder"
targetFolder=$2
if [ ! -d "$targetFolder" ]; then
mkdir -p "$targetFolder"
fi

cd "$latestFolder"
cd "$targetFolder"

zipDownloadedFile="microweber-app.zip";
zipDownloadedFile="$3";

echo 'Download from url...'
#wget "$downloadUrl" -O "$zipDownloadedFile"
echo 'Download from url:' "$downloadUrl";

wget "$downloadUrl" -O "$zipDownloadedFile"

0 comments on commit 6d903f7

Please sign in to comment.