@@ -54,16 +54,16 @@ public function fetchStarterKit($starterkit = "") {
54
54
if (empty ($ starterkit )) {
55
55
Console::writeError ("please provide a path for the starterkit before trying to fetch it... " );
56
56
}
57
-
57
+
58
+ // figure out the options for the GH path
59
+ list ($ org ,$ repo ,$ tag ) = $ this ->getPackageInfo ($ starterkit );
60
+
58
61
// set default attributes
59
62
$ sourceDir = Config::getOption ("sourceDir " );
60
63
$ tempDir = sys_get_temp_dir ().DIRECTORY_SEPARATOR ."pl-sk " ;
61
64
$ tempDirSK = $ tempDir .DIRECTORY_SEPARATOR ."pl-sk-archive " ;
62
- $ tempDirDist = $ tempDirSK .DIRECTORY_SEPARATOR ."dist " ;
63
- $ tempComposerFile = $ tempDirSK .DIRECTORY_SEPARATOR ."composer.json " ;
64
-
65
- // figure out the options for the GH path
66
- list ($ org ,$ repo ,$ tag ) = $ this ->getPackageInfo ($ starterkit );
65
+ $ tempDirDist = $ tempDirSK .DIRECTORY_SEPARATOR .$ repo ."- " .$ tag .DIRECTORY_SEPARATOR ."dist " ;
66
+ $ tempComposerFile = $ tempDirSK .DIRECTORY_SEPARATOR .$ repo ."- " .$ tag .DIRECTORY_SEPARATOR ."composer.json " ;
67
67
68
68
//get the path to the GH repo and validate it
69
69
$ tarballUrl = "https://github.com/ " .$ org ."/ " .$ repo ."/archive/ " .$ tag .".tar.gz " ;
@@ -99,7 +99,11 @@ public function fetchStarterKit($starterkit = "") {
99
99
$ zippy = Zippy::load ();
100
100
$ zippy ->addStrategy (new UnpackFileStrategy ());
101
101
$ zippy ->getAdapterFor ('tar.gz ' )->open ($ tempFile )->extract ($ tempDirSK );
102
-
102
+
103
+ if (!is_dir ($ tempDirDist )) {
104
+ // try without repo dir
105
+ $ tempDirDist = $ tempDirSK .DIRECTORY_SEPARATOR ."dist " ;
106
+ }
103
107
// thrown an error if temp/dist/ doesn't exist
104
108
if (!is_dir ($ tempDirDist )) {
105
109
Console::writeError ("the starterkit needs to contain a dist/ directory before it can be installed... " );
0 commit comments