Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
refs #67
Browse files Browse the repository at this point in the history
* chown / chgrp for .rancherize directory
  • Loading branch information
Bastian Rang committed Oct 11, 2017
1 parent 818fe0b commit 7c80288
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/Services/BuildService.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,18 @@ public function setVersion(string $version) {
protected function createTemporaryDirectory(): string {
$directory = './.rancherize/';

if (!file_exists($directory))
mkdir($directory);
if (!file_exists($directory)) {
mkdir($directory);

/**
* Set user/group corresponding to executing user
*/
if ( !empty($_ENV['USER_ID']) )
chown($directory, (int) getenv('USER_ID'));

if ( !empty($_ENV['GROUP_ID']) )
chgrp($directory, (int) getenv('GROUP_ID'));
}

return $directory;
}
Expand Down

0 comments on commit 7c80288

Please sign in to comment.