Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme create command windows support #2058

Merged
merged 7 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE

+ [#2051](https://github.com/luyadev/luya/pull/2051) Add new string helper method (`luya\helpers\String::textList()`) which converts a string with items seperated by commas or whitespaces into an array with items.
+ [#2049](https://github.com/luyadev/luya/pull/2049) Change the behaviors attaching order to follow [Yii CORS guide](https://www.yiiframework.com/doc/guide/2.0/en/rest-controllers#cors).
+ [#8](https://github.com/luyadev/luya-themes/issues/8) Theme create command with DIRECTORY_SEPARATOR.

## 1.7.0 (26. August 2020)

Expand Down
12 changes: 6 additions & 6 deletions core/console/commands/ThemeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function actionCreate(string $themeName = null)
}
}

$basePath = $themeLocation . '/themes/' . $themeName;
$basePath = $themeLocation . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName;
$themeFolder = Yii::getAlias($basePath);

if (file_exists($themeFolder)) {
Expand All @@ -76,8 +76,8 @@ public function actionCreate(string $themeName = null)
'',
'resources',
'views',
'views/layouts',
'views/cmslayouts',
'views'.DIRECTORY_SEPARATOR.'layouts',
'views'.DIRECTORY_SEPARATOR.'cmslayouts',
];

foreach ($folders as $folder) {
Expand All @@ -87,9 +87,9 @@ public function actionCreate(string $themeName = null)
$contents = [
$themeFolder. DIRECTORY_SEPARATOR . 'theme.json' => $this->renderJson($basePath, $themeName),
$themeFolder. DIRECTORY_SEPARATOR . ucfirst($themeName) . 'Asset.php' => $this->renderAssetClass($themeName),
$themeFolder. DIRECTORY_SEPARATOR . 'resources/'. $themeName .'.css' => '',
$themeFolder. DIRECTORY_SEPARATOR . 'views/layouts/theme.php' => $this->renderLayout($themeName),
$themeFolder. DIRECTORY_SEPARATOR . 'views/cmslayouts/theme.php' => $this->renderCmsLayout($themeName),
$themeFolder. DIRECTORY_SEPARATOR . 'resources'.DIRECTORY_SEPARATOR. $themeName .'.css' => '',
$themeFolder. DIRECTORY_SEPARATOR . 'views'.DIRECTORY_SEPARATOR.'layouts'.DIRECTORY_SEPARATOR.'theme.php' => $this->renderLayout($themeName),
$themeFolder. DIRECTORY_SEPARATOR . 'views'.DIRECTORY_SEPARATOR.'cmslayouts'.DIRECTORY_SEPARATOR.'theme.php' => $this->renderCmsLayout($themeName),
];

foreach ($contents as $fileName => $content) {
Expand Down