Skip to content

Commit

Permalink
Merge pull request #348 from magento/coreected-file-structure-for-ove…
Browse files Browse the repository at this point in the history
…rride-in-theme-action

Fixed directory structure for the override in theme action
  • Loading branch information
coderimus authored Oct 23, 2020
2 parents aa473de + cd74ecc commit 184a422
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).

## 2.0.1

### Fixed

- Directories structure for the override in theme action
- Constant disabling plugin on startup if Magento not in the root
- New module generation for the default Magento version

## 2.0.0

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiFile;
import com.maddyhome.idea.copyright.actions.UpdateCopyrightProcessor;
import com.magento.idea.magento2plugin.actions.generation.generator.util.DirectoryGenerator;
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
import com.magento.idea.magento2plugin.indexes.ModuleIndex;
import com.magento.idea.magento2plugin.magento.packages.Areas;
Expand Down Expand Up @@ -126,16 +127,9 @@ private PsiDirectory getTargetDirectory(
PsiDirectory directory, //NOPMD
final List<String> pathComponents
) {
final DirectoryGenerator generator = DirectoryGenerator.getInstance();
for (final String directoryName : pathComponents) {
if (directory.findSubdirectory(directoryName) != null) { //NOPMD
directory = directory.findSubdirectory(directoryName);
} else {
final PsiDirectory finalDirectory = directory;
ApplicationManager.getApplication().runWriteAction(() -> {
finalDirectory.createSubdirectory(directoryName);
});
return finalDirectory;
}
directory = generator.findOrCreateSubdirectory(directory, directoryName);
}

return directory;
Expand Down

0 comments on commit 184a422

Please sign in to comment.