fix: extract WordPress ZIP without external tools
This commit is contained in:
@@ -38,7 +38,7 @@ jobs:
|
|||||||
test -f dist/native-runtime/aurora-native-0.1.0-linux-x64.tar.gz
|
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
|
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
|
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
|
test -f dist/linux-unpacked/resources/module-catalog/drupal-1.0.0.pac
|
||||||
|
|
||||||
- name: Create checksums
|
- name: Create checksums
|
||||||
|
|||||||
@@ -76,10 +76,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Verify embedded PAC catalog
|
- name: Verify embedded PAC catalog
|
||||||
run: |
|
run: |
|
||||||
test -f dist/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.1.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.1.pac "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.1.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.1.pac"
|
unzip -t "dist/mac-universal/Aurora Dockside.app/Contents/Resources/module-catalog/wordpress-1.2.2.pac"
|
||||||
|
|
||||||
- name: Create checksums
|
- name: Create checksums
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "aurora-dockside",
|
"name": "aurora-dockside",
|
||||||
"version": "2.0.0-alpha.38",
|
"version": "2.0.0-alpha.39",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "aurora-dockside",
|
"name": "aurora-dockside",
|
||||||
"version": "2.0.0-alpha.38",
|
"version": "2.0.0-alpha.39",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@electron-toolkit/preload": "^3.0.2",
|
"@electron-toolkit/preload": "^3.0.2",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aurora-dockside",
|
"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.",
|
"description": "A modern, modular Docker development platform for building, running, and managing web applications locally.",
|
||||||
"desktopName": "aurora-dockside.desktop",
|
"desktopName": "aurora-dockside.desktop",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
|
|||||||
@@ -73,12 +73,24 @@ exports.projectCreate = async function projectCreate(context) {
|
|||||||
'--remove-orphans'
|
'--remove-orphans'
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
await context.run(
|
if (native && nativePhpPrefix.length) {
|
||||||
'download',
|
const target = Buffer.from(context.directory, 'utf8').toString('base64')
|
||||||
command,
|
const locale = encodeURIComponent(String(s.locale || 'en_US'))
|
||||||
[...base, 'core', 'download', `--locale=${s.locale || 'en_US'}`, '--force'],
|
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);`
|
||||||
native ? context.native.commandEnvironment : undefined
|
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(
|
await context.run(
|
||||||
'config',
|
'config',
|
||||||
command,
|
command,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "wordpress",
|
"id": "wordpress",
|
||||||
"name": "WordPress",
|
"name": "WordPress",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"category": "application",
|
"category": "application",
|
||||||
"description": "WordPress CMS provisioning and WP-CLI tooling.",
|
"description": "WordPress CMS provisioning and WP-CLI tooling.",
|
||||||
"main": "main/index.cjs",
|
"main": "main/index.cjs",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@aurora/module-wordpress",
|
"name": "@aurora/module-wordpress",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "WordPress application module for Aurora Dockside",
|
"description": "WordPress application module for Aurora Dockside",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
Reference in New Issue
Block a user