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

Commit

Permalink
It can create again (global or dev install)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajthinking committed May 8, 2018
1 parent ab4b4a2 commit 34743eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/Stimpack/Manipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ public static function projects() {
chdir(public_path());
return $projects;
}

protected function env($key, $defaultAlsoAppliesIfEmpty)
{
$value = env($key, "");
if($value == "") {
return $defaultAlsoAppliesIfEmpty;
}

return $value;
}
}
3 changes: 1 addition & 2 deletions app/Stimpack/Manipulators/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public function perform() {
$zip = new ZipArchive;
$res = $zip->open(storage_path("stimpack/laravel.zip"));
if ($res === TRUE) {
return env('STIMPACK_CODE_PATH') . "/" . $this->data->path;
$zip->extractTo(env('STIMPACK_CODE_PATH', '/home/anders/Code') . "/" . $this->data->path);
$zip->extractTo($this->env('STIMPACK_CODE_PATH', base_path("../")) . $this->data->path);
$zip->close();
} else {
return "some Error?";
Expand Down

0 comments on commit 34743eb

Please sign in to comment.