Skip to content

Commit

Permalink
Closes #203
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Aug 11, 2019
1 parent 2879710 commit 8d547af
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/shared/PharRegistry.php
Expand Up @@ -172,6 +172,14 @@ public function getKnownSignatureFingerprints(string $alias): array {

private function savePhar(Phar $phar): Filename {
$destination = new Filename($this->getPharDestination($phar));

$targetDir = $destination->getDirectory();
if (!$targetDir->isWritable()) {
throw new FileNotWritableException(
sprintf('Cannot write phar to %s', $targetDir->asString())
);
}

$phar->getFile()->saveAs($destination);
\chmod($destination->asString(), 0755);

Expand Down

0 comments on commit 8d547af

Please sign in to comment.