Skip to content

Commit

Permalink
consolidation#497 Fix: Add Basic Self Update Functionality: enable se…
Browse files Browse the repository at this point in the history
…lf-update only if phar
  • Loading branch information
amenk committed Aug 30, 2017
1 parent b51b882 commit bcbcce6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,17 @@ protected function getLatestReleaseFromGithub()
return [ $version, $url ];
}

public function isEnabled() {
return !empty(\Phar::running());
}


/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{

$localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0];
$programName = basename($localFilename);
$tempFilename = dirname($localFilename) . '/' . basename($localFilename, '.phar') . '-temp.phar';
Expand Down

0 comments on commit bcbcce6

Please sign in to comment.