Skip to content

Commit 4a1af74

Browse files
committed
support dual-architecture binaries
1 parent f7c92a6 commit 4a1af74

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stonegray/plugin-detect",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"main": "./src/index.js",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1"

src/scanPlugin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,13 @@ export async function scanPlugin(plugin) {
113113
case 'cffaedfe12000001':
114114
info.arch = ['arm64'];
115115
break;
116+
117+
case 'cafebabe00000002':
118+
info.arch = ['arm64', 'x64'];
119+
break;
116120

117121
default:
118-
info.errors.push('Unknown architecture: '+headerBytesHex.toUpperCase);
122+
info.errors.push('Unknown architecture: '+headerBytesHex.toUpperCase());
119123
break;
120124
}
121125

src/util/readPlistFile.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@ export default async function readPlistFile(pluginPath) {
1212
try {
1313
fileContents = await fs.promises.readFile(plistFile, 'utf8');
1414
} catch (e) {
15-
console.error('Skipped plugin, missing Info.plist: ' + pluginPath);
15+
//console.error('Skipped plugin, missing Info.plist: ' + pluginPath);
1616
return e;
1717
}
1818

1919
let retValue;
2020
try {
21+
22+
//const plist = await import('plist');
23+
//console.log(plist.default);
24+
//retValue = plist.default.parse(fileContents);
2125
retValue = plist.parse(fileContents);
2226
} catch (e){
27+
//console.error('Skipped plugin, parse error: ' + e + pluginPath);
2328
return e;
2429
}
25-
2630
return retValue;
2731

2832
}

0 commit comments

Comments
 (0)