Skip to content

Commit

Permalink
Use fully qualified theme names (#486)
Browse files Browse the repository at this point in the history
Both are technically fine, this just prevents conflicts with authors where the theme name is identical
  • Loading branch information
daftspunk authored Apr 5, 2021
1 parent 260a3b3 commit 0f4a400
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Composer/Installers/OctoberInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class OctoberInstaller extends BaseInstaller
protected $locations = array(
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/'
'theme' => 'themes/{$vendor}-{$name}/'
);

/**
Expand Down Expand Up @@ -41,6 +41,7 @@ protected function inflectPluginVars($vars)
protected function inflectThemeVars($vars)
{
$vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
$vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);

return $vars;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Composer/Installers/Test/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public function dataForTestInstallPath()
array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
array('october-theme', 'themes/shama-my_theme/', 'shama/my_theme'),
array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),
array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),
Expand Down

0 comments on commit 0f4a400

Please sign in to comment.