|
22 | 22 | use Symfony\Component\Config\Definition\Processor;
|
23 | 23 | use Symfony\Component\Config\Loader\DelegatingLoader;
|
24 | 24 | use Symfony\Component\Config\Loader\LoaderResolver;
|
| 25 | +use Symfony\Component\Filesystem\Path; |
25 | 26 | use Symfony\Component\Finder\Finder;
|
26 | 27 |
|
27 | 28 | /**
|
@@ -49,13 +50,14 @@ public function getName(): string
|
49 | 50 |
|
50 | 51 | public function shouldRun(): bool
|
51 | 52 | {
|
52 |
| - if (!file_exists($this->themesPath)) { |
| 53 | + $themesPath = Path::join($this->rootDir, $this->themesPath); |
| 54 | + if (!file_exists($themesPath)) { |
53 | 55 | return false;
|
54 | 56 | }
|
55 | 57 |
|
56 | 58 | $manifests = (new Finder())
|
57 | 59 | ->files()
|
58 |
| - ->in($this->themesPath) |
| 60 | + ->in($themesPath) |
59 | 61 | ->name(['theme.yml', 'theme.yaml'])
|
60 | 62 | ->getIterator()
|
61 | 63 | ;
|
@@ -88,9 +90,10 @@ public function shouldRun(): bool
|
88 | 90 |
|
89 | 91 | public function run(): MigrationResult
|
90 | 92 | {
|
| 93 | + $themesPath = Path::join($this->rootDir, $this->themesPath); |
91 | 94 | $manifests = (new Finder())
|
92 | 95 | ->files()
|
93 |
| - ->in($this->themesPath) |
| 96 | + ->in($themesPath) |
94 | 97 | ->name(['theme.yml', 'theme.yaml'])
|
95 | 98 | ->getIterator()
|
96 | 99 | ;
|
@@ -180,13 +183,11 @@ private function persistTheme($id, $name, string $themeName, string $manifestHas
|
180 | 183 | {
|
181 | 184 | $themeId = $id ?? null;
|
182 | 185 |
|
183 |
| - $themePath = str_replace($this->rootDir.'/', '', $this->themesPath); |
184 |
| - |
185 | 186 | $data = [
|
186 | 187 | 'name' => $name,
|
187 | 188 | 'alias' => $themeName,
|
188 | 189 | 'tstamp' => time(),
|
189 |
| - 'templates' => sprintf('%s/%s/templates', $themePath, $themeName), |
| 190 | + 'templates' => sprintf('%s/%s/templates', $this->themesPath, $themeName), |
190 | 191 | 'manifestHash' => $manifestHash,
|
191 | 192 | ];
|
192 | 193 |
|
|
0 commit comments