Skip to content

Commit f636a44

Browse files
committed
fix: fix update for nginx
1 parent 392ed8b commit f636a44

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Model/InformationModel.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ public function vfUpdate()
306306
{
307307
try {
308308
$rootFolder = $this->driverFile->getRealPath($this->dir->getRoot());
309+
$pubFolder = $this->driverFile->getRealPath($this->dir->getPath('pub'));
309310
$moduleDir = $this->moduleReader->getModuleDir(
310311
\Magento\Framework\Module\Dir::MODULE_VIEW_DIR,
311312
'Vuefront_Vuefront'
@@ -315,9 +316,15 @@ public function vfUpdate()
315316
$moduleDir . '/adminhtml/web/js/download.tar',
316317
$this->driverFile->fileGetContents($this->request->getBodyParams()['url'])
317318
);
318-
$this->file->rmdirRecursive($rootFolder . '/vuefront');
319+
if (strpos($this->request->getServerValue("SERVER_SOFTWARE"), "Apache") !== false) {
320+
$this->file->rmdirRecursive($rootFolder . '/vuefront');
321+
322+
$this->arhiveTar->unpack($moduleDir . '/adminhtml/web/js/download.tar', $rootFolder . '/vuefront//');
323+
} else {
324+
$this->file->rmdirRecursive($pubFolder . '/vuefront');
319325

320-
$this->arhiveTar->unpack($moduleDir . '/adminhtml/web/js/download.tar', $rootFolder . '/vuefront//');
326+
$this->arhiveTar->unpack($moduleDir . '/adminhtml/web/js/download.tar', $pubFolder . '/vuefront//');
327+
}
321328

322329
$this->file->rm($moduleDir . '/adminhtml/web/js/download.tar');
323330
} catch (\Exception $e) {

0 commit comments

Comments
 (0)