From 15f89b51ada1036aaff1b9f4f928d1281b7850f4 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 3 Jun 2021 08:35:29 +0200 Subject: [PATCH] Structure check: update file check for block themes (#32) 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. --- actions/structure-check/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/structure-check/index.js b/actions/structure-check/index.js index becfd83..f4a6804 100644 --- a/actions/structure-check/index.js +++ b/actions/structure-check/index.js @@ -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; } @@ -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; }