Skip to content

Commit 3941603

Browse files
committed
fix: don't hardcode environments when creating a project
1 parent 9486365 commit 3941603

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ApiClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ public function createNetwork(int $providerId, string $name, string $region): Co
198198
/**
199199
* Create a new project with the given cloud provider.
200200
*/
201-
public function createProject(int $providerId, string $name, string $region): Collection
201+
public function createProject(int $providerId, string $name, string $region, array $environments = []): Collection
202202
{
203-
return $this->client->createProject($providerId, $name, $region, ['staging', 'production']);
203+
return $this->client->createProject($providerId, $name, $region, $environments);
204204
}
205205

206206
/**

src/Command/Project/InitializeProjectCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ protected function perform(InputInterface $input, OutputInterface $output)
135135
// needs an empty directory.
136136
$this->checkForWordPress($output, $projectType);
137137

138-
$this->projectConfiguration->createNew($this->apiClient->createProject($providerId, $projectName, $region), $environments->all(), $projectType);
138+
$this->projectConfiguration->createNew($this->apiClient->createProject($providerId, $projectName, $region, $environments->keys()->all()), $environments->all(), $projectType);
139139

140140
$output->infoWithDelayWarning('Project initialized');
141141

0 commit comments

Comments
 (0)