Skip to content

Commit

Permalink
Theme commands: Check if tar is installed before executing commands
Browse files Browse the repository at this point in the history
  • Loading branch information
igaster committed Feb 27, 2019
1 parent d2d091d commit 3e31d10
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Commands/createPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "") {
Expand Down
11 changes: 11 additions & 0 deletions src/Commands/installPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3e31d10

Please sign in to comment.