Skip to content

Commit 5e758b8

Browse files
committed
Fix the project folder is not created on project creation
1 parent 6f250ef commit 5e758b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Commands/Projects/CreateCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
6060

6161
$cwd = sprintf('%s/%s', $this->config->home(), $name);
6262
$file = sprintf('%s/%s/project.yaml', $this->config->home(), $name);
63+
$dir = sprintf('%s/%s/%s', $_SERVER['HOME'], $this->config->projectsDir(), $name);
6364

6465
if ($git) {
6566
$ret = $this->createFromGitRepo($git, $cwd, $file);
6667
} else {
6768
$ret = $this->createNewLocalProject($cwd, $file, $name, $docker, $git);
6869
}
6970

71+
if (!file_exists($dir)) {
72+
@mkdir($dir, 0755, true);
73+
}
74+
7075
$this->tools()->newline();
7176

7277
return $ret;
@@ -127,7 +132,7 @@ protected function createFromGitRepo(string $git, string $cwd, string $file): in
127132

128133
$name = Yaml::parseFile($file)['somnambulist']['project']['name'];
129134

130-
$this->tools()->success('enable the project by running: <info>use %s</info>', $name);
135+
$this->tools()->success('enable the project by running: <info>spm use %s</info>', $name);
131136

132137
return 0;
133138
}
@@ -165,7 +170,7 @@ protected function createNewLocalProject(string $cwd, string $file, string $name
165170
}
166171

167172
$this->tools()->success('created git repository at <info>%s</info>', $cwd);
168-
$this->tools()->success('project created successfully, enable the project by running: <info>use %s</info>', $name);
173+
$this->tools()->success('project created successfully, enable the project by running: <info>spm use %s</info>', $name);
169174

170175
return 0;
171176
}

0 commit comments

Comments
 (0)