Skip to content

Commit c546749

Browse files
committed
Make sure the traefik/config directory is available
1 parent 048ff2d commit c546749

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gally/scripts/setup/traefik.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#ddev-generated
33
#ddev-description: Create default .env file
44

5+
$appRoot = $_ENV['DDEV_APPROOT'];
56
$projectName = $_ENV['DDEV_PROJECT'];
67

78
$content = <<<EOT
@@ -27,4 +28,8 @@
2728
- url: "http://ddev-$projectName-gally:80"
2829
EOT;
2930

30-
file_put_contents(sprintf('traefik/config/%s_gally.yaml', $projectName), $content);
31+
if (!is_dir(sprintf('%s/traefik/config', $appRoot))) {
32+
mkdir(sprintf('%s/traefik/config', $appRoot), 0777, true);
33+
}
34+
35+
file_put_contents(sprintf('%s/traefik/config/%s_gally.yaml', $appRoot, $projectName), $content);

0 commit comments

Comments
 (0)