Skip to content

Commit

Permalink
Structure check: update file check for block themes (#32)
Browse files Browse the repository at this point in the history
Functions.php is not required for themes.
Block themes uploaded to the theme directory require theme.json.
This requirement is not published yet. It will be shortly.

Updates the logged messages.
  • Loading branch information
carolinan authored Jun 3, 2021
1 parent d138868 commit 15f89b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions actions/structure-check/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ const fileExists = (filePath) => {

// Child Themes don't require an index.php
if (!isChildTheme() && !fileExists(`${ROOT_PATH_THEME}/index.php`)) {
appendToLog('We require you have an index.php file.');
appendToLog('The theme is required to have an index.php file.');
hasErrors = true;
}

// Block based themes require function.php
// Block themes require theme.json
if (
isBlockBasedTheme() &&
!fileExists(`${ROOT_PATH_THEME}/functions.php`)
!fileExists(`${ROOT_PATH_THEME}/theme.json`)
) {
appendToLog(
'We require you have an function.php file for a Block Based theme.'
'Block themes are quired to have a theme.json file.'
);
hasErrors = true;
}

if (!fileExists(`${ROOT_PATH_THEME}/style.css`)) {
appendToLog('We require you have a style.css file.');
appendToLog('The theme is required to have a style.css file.');
hasErrors = true;
}

Expand All @@ -77,7 +77,7 @@ const fileExists = (filePath) => {
!fileExists(`${ROOT_PATH_THEME}/screenshot.jpeg`)
) {
appendToLog(
'We require you have a screenshot.png or screenshot.jpg file.'
'The theme is required to have a screenshot.png or screenshot.jpg file.'
);
hasErrors = true;
}
Expand Down

0 comments on commit 15f89b5

Please sign in to comment.