From a3bb786c50ec484c26735a409751e215050a6050 Mon Sep 17 00:00:00 2001 From: Jelle Sebreghts Date: Wed, 24 Jun 2020 14:30:18 +0200 Subject: [PATCH] Check if yarn install is needed. --- src/RoboFileBase.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/RoboFileBase.php b/src/RoboFileBase.php index 5546a93..1da12f9 100644 --- a/src/RoboFileBase.php +++ b/src/RoboFileBase.php @@ -150,23 +150,25 @@ protected function buildTask($archivename = null) { $archive = is_null($archivename) ? $this->time . '.tar.gz' : $archivename; $collection = $this->collectionBuilder(); - $collection - ->taskThemeCompile() - ->taskExec($this->findExecutable('yarn') . ' run encore production') - ->taskThemeClean() - ->taskPackageProject($archive) - ->ignoreFileNames([ - '.gitattributes', - '.gitignore', - '.gitkeep', - 'README', - 'README.txt', - 'README.md', - 'LICENSE', - 'LICENSE.txt', - 'LICENSE.md', - 'phpunit.xml.dist' - ]); + if (file_exists('package.json')) { + $collection + ->taskThemeCompile() + ->taskExec($this->findExecutable('yarn') . ' run encore production') + ->taskThemeClean(); + } + $collection->taskPackageProject($archive) + ->ignoreFileNames([ + '.gitattributes', + '.gitignore', + '.gitkeep', + 'README', + 'README.txt', + 'README.md', + 'LICENSE', + 'LICENSE.txt', + 'LICENSE.md', + 'phpunit.xml.dist' + ]); return $collection; }