From 3e31d10dd5a6623d64b0f6678163ede07c4f6669 Mon Sep 17 00:00:00 2001 From: Giannis Gasteratos Date: Thu, 28 Feb 2019 00:03:23 +0200 Subject: [PATCH] Theme commands: Check if tar is installed before executing commands --- src/Commands/createPackage.php | 11 +++++++++++ src/Commands/installPackage.php | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Commands/createPackage.php b/src/Commands/createPackage.php index 526656e..65a9a35 100644 --- a/src/Commands/createPackage.php +++ b/src/Commands/createPackage.php @@ -10,6 +10,17 @@ class createPackage extends baseCommand public function handle() { + // Check if tar exists + exec("tar --version", $output, $status); + + if($status !== 0 ) { + + $this->info('Error: tar executable could not be found. Please install tar utility before you can continue'); + + return; + + } + $themeName = $this->argument('themeName'); if ($themeName == "") { diff --git a/src/Commands/installPackage.php b/src/Commands/installPackage.php index 82a50c9..369e3e8 100644 --- a/src/Commands/installPackage.php +++ b/src/Commands/installPackage.php @@ -10,6 +10,17 @@ class installPackage extends baseCommand public function handle() { + // Check if tar exists + exec("tar --version", $output, $status); + + if($status !== 0 ) { + + $this->info('Error: tar executable could not be found. Please install tar utility before you can continue'); + + return; + + } + $package = $this->argument('package'); if (!$package) {