Deploy: Use the requirement rather than the tested version (#5235)
This commit is contained in:
parent
2ef8a95e1f
commit
68715b8323
1 changed files with 3 additions and 4 deletions
|
@ -191,7 +191,7 @@ async function buildComZip(themeSlug) {
|
|||
|
||||
// Gets the theme version (Version:) and minimum WP version (Tested up to:) from the theme's style.css
|
||||
let themeVersion = getThemeMetadata(styleCss, 'Version');
|
||||
let wpVersionCompat = getThemeMetadata(styleCss, 'Tested up to');
|
||||
let wpVersionCompat = getThemeMetadata(styleCss, 'Requires at least');
|
||||
|
||||
if (themeVersion && wpVersionCompat) {
|
||||
await executeOnSandbox(`php ${sandboxRootFolder}bin/themes/theme-downloads/build-theme-zip.php --stylesheet=pub/${themeSlug} --themeversion=${themeVersion} --wpversioncompat=${wpVersionCompat}`, true);
|
||||
|
@ -379,9 +379,9 @@ function getThemeMetadata(styleCss, attribute) {
|
|||
.match(/(?<=Version:\s*).*?(?=\s*\r?\n|\rg)/gs)[0]
|
||||
.trim()
|
||||
.replace('-wpcom', '');
|
||||
case 'Tested up to':
|
||||
case 'Requires at least':
|
||||
return styleCss
|
||||
.match(/(?<=Tested up to:\s*).*?(?=\s*\r?\n|\rg)/gs);
|
||||
.match(/(?<=Requires at least:\s*).*?(?=\s*\r?\n|\rg)/gs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -838,4 +838,3 @@ async function executeCommand(command, logResponse) {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue