Skip to content

Commit 43369eb

Browse files
committed
Bugfix: wrong target, missing css files
1 parent 70d8eb2 commit 43369eb

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/OpenMage/Composer/Plugin.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ public function processTinyMce(Event $event): void
5353
$composer = $event->getComposer();
5454
$extra = $composer->getPackage()->getExtra();
5555

56-
$magentoRootDir = array_key_exists(self::EXTRA_MAGENTO_ROOT_DIR, $extra) ? $extra[self::EXTRA_MAGENTO_ROOT_DIR] : '.';
57-
$magentoRootDir .= '/';
56+
$magentoRootDir = '';
57+
if (array_key_exists(self::EXTRA_MAGENTO_ROOT_DIR, $extra) && $extra[self::EXTRA_MAGENTO_ROOT_DIR] !== '.') {
58+
$magentoRootDir = $extra[self::EXTRA_MAGENTO_ROOT_DIR] . '/';
59+
}
5860

5961
$plugin = new Plugin\TinyMce();
6062
$plugin->process($event, $magentoRootDir);

src/OpenMage/Composer/Plugin/TinyMce.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ public function process(Event $event, string $magentoRootDir): void
6363
foreach (self::$modules as $moduleName => $copyTarget) {
6464
$tinyMceModule = $this->getTinyMceModule($event, $io, $moduleName);
6565
if ($tinyMceModule) {
66-
$rootDir = getcwd();
66+
$rootDir = getcwd();
6767
/** @var string $vendorDir */
6868
$vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
6969

7070
$version = $this->getInstalledVersion(self::TINYMCE_MODULE);
7171
$mainVersion = $version[0] ?? null;
7272

7373
$copySource = $vendorDir . '/' . $moduleName;
74-
$copyTarget = $rootDir . '/' . $copyTarget;
74+
$copyTarget = $rootDir . '/' . $magentoRootDir . $copyTarget;
7575

7676
if ($moduleName === self::TINYMCE_MODULE) {
7777
switch ((int) $mainVersion) {
@@ -93,7 +93,7 @@ public function process(Event $event, string $magentoRootDir): void
9393
$copySource = $copySource . '/langs' . $mainVersion;
9494
}
9595

96-
$this->copy($io, $copySource, $magentoRootDir . $copyTarget);
96+
$this->copy($io, $copySource, $copyTarget);
9797
}
9898
}
9999
}
@@ -133,7 +133,11 @@ private function copy(IOInterface $io, string $source, string $target): void
133133
{
134134
$filesystem = new Filesystem();
135135
$finder = new Finder();
136-
$finder->in($source)->name('*.js');
136+
$finder
137+
->files()
138+
->in($source)
139+
->name('*.css')
140+
->name('*.js');
137141
foreach ($finder as $file) {
138142
$copySource = $file->getPathname();
139143
$copytarget = $target . '/' . $file->getRelativePathname();

0 commit comments

Comments
 (0)