fix: extract WordPress ZIP without external tools

This commit is contained in:
reaper
2026-08-28 08:29:00 -05:00
parent 3d91e90b2f
commit e29133613a
7 changed files with 28 additions and 16 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
test -f dist/native-runtime/aurora-native-0.1.0-linux-x64.tar.gz
test -f dist/linux-unpacked/resources/native-runtime/aurora-native-0.1.0-linux-x64.tar.gz
cmp dist/native-runtime/aurora-native-0.1.0-linux-x64.tar.gz dist/linux-unpacked/resources/native-runtime/aurora-native-0.1.0-linux-x64.tar.gz
test -f dist/linux-unpacked/resources/module-catalog/wordpress-1.2.1.pac
test -f dist/linux-unpacked/resources/module-catalog/wordpress-1.2.2.pac
test -f dist/linux-unpacked/resources/module-catalog/drupal-1.0.0.pac
- name: Create checksums
+4 -4
View File
@@ -76,10 +76,10 @@ jobs:
- name: Verify embedded PAC catalog
run: |
test -f dist/module-catalog/wordpress-1.2.1.pac
test -f "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.1.pac"
cmp dist/module-catalog/wordpress-1.2.1.pac "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.1.pac"
unzip -t "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.1.pac"
test -f dist/module-catalog/wordpress-1.2.2.pac
test -f "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.2.pac"
cmp dist/module-catalog/wordpress-1.2.2.pac "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.2.pac"
unzip -t "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.2.pac"
- name: Create checksums
run: |
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "aurora-dockside",
"version": "2.0.0-alpha.38",
"version": "2.0.0-alpha.39",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "aurora-dockside",
"version": "2.0.0-alpha.38",
"version": "2.0.0-alpha.39",
"hasInstallScript": true,
"dependencies": {
"@electron-toolkit/preload": "^3.0.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "aurora-dockside",
"version": "2.0.0-alpha.38",
"version": "2.0.0-alpha.39",
"description": "A modern, modular Docker development platform for building, running, and managing web applications locally.",
"desktopName": "aurora-dockside.desktop",
"main": "./out/main/index.js",
@@ -73,12 +73,24 @@ exports.projectCreate = async function projectCreate(context) {
'--remove-orphans'
])
}
await context.run(
'download',
command,
[...base, 'core', 'download', `--locale=${s.locale || 'en_US'}`, '--force'],
native ? context.native.commandEnvironment : undefined
)
if (native && nativePhpPrefix.length) {
const target = Buffer.from(context.directory, 'utf8').toString('base64')
const locale = encodeURIComponent(String(s.locale || 'en_US'))
const download = `$target=base64_decode('${target}');$work=$target.DIRECTORY_SEPARATOR.'.aurora'.DIRECTORY_SEPARATOR.'wordpress-download';$archive=$work.'.zip';@mkdir($work,0777,true);$api=json_decode(file_get_contents('https://api.wordpress.org/core/version-check/1.7/?locale=${locale}'),true);$offer=$api['offers'][0]??null;$url=$offer['packages']['full']??$offer['download']??null;if(!$url||!copy($url,$archive))throw new Exception('Unable to download WordPress.');$zip=new ZipArchive();if($zip->open($archive)!==true)throw new Exception('Unable to open WordPress archive.');if(!$zip->extractTo($work))throw new Exception('Unable to extract WordPress archive.');$zip->close();$source=$work.DIRECTORY_SEPARATOR.'wordpress';foreach(scandir($source) as $entry){if($entry==='.'||$entry==='..')continue;if(!rename($source.DIRECTORY_SEPARATOR.$entry,$target.DIRECTORY_SEPARATOR.$entry))throw new Exception('Unable to install WordPress file: '.$entry);}@rmdir($source);@rmdir($work);@unlink($archive);`
await context.run(
'download',
context.native.php,
[...nativePhpPrefix, '-r', download],
context.native.commandEnvironment
)
} else {
await context.run(
'download',
command,
[...base, 'core', 'download', `--locale=${s.locale || 'en_US'}`, '--force'],
native ? context.native.commandEnvironment : undefined
)
}
await context.run(
'config',
command,
@@ -1,7 +1,7 @@
{
"id": "wordpress",
"name": "WordPress",
"version": "1.2.1",
"version": "1.2.2",
"category": "application",
"description": "WordPress CMS provisioning and WP-CLI tooling.",
"main": "main/index.cjs",
@@ -1,6 +1,6 @@
{
"name": "@aurora/module-wordpress",
"version": "1.2.1",
"version": "1.2.2",
"private": true,
"description": "WordPress application module for Aurora Dockside",
"files": [