chore: harder checks around universal build creation

This commit is contained in:
deepak1556 2021-08-05 23:55:06 -07:00
parent 49af1cbe00
commit d49d7e7fe1
2 changed files with 15 additions and 0 deletions

View file

@ -5,6 +5,7 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const vscode_universal_bundler_1 = require("vscode-universal-bundler");
const cross_spawn_promise_1 = require("@malept/cross-spawn-promise");
const fs = require("fs-extra");
const path = require("path");
const plist = require("plist");
@ -50,6 +51,12 @@ async function main() {
LSRequiresNativeExecution: true
});
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
// Verify if native module architecture is correct
const findOutput = await (0, cross_spawn_promise_1.spawn)('find', [outAppPath, '-name', 'keytar.node']);
const lipoOutput = await (0, cross_spawn_promise_1.spawn)('lipo', ['-archs', findOutput.replace(/\n$/, "")]);
if (lipoOutput.replace(/\n$/, "") !== 'x86_64 arm64') {
throw new Error(`Invalid arch, got : ${lipoOutput}`);
}
}
if (require.main === module) {
main().catch(err => {

View file

@ -6,6 +6,7 @@
'use strict';
import { makeUniversalApp } from 'vscode-universal-bundler';
import { spawn } from '@malept/cross-spawn-promise';
import * as fs from 'fs-extra';
import * as path from 'path';
import * as plist from 'plist';
@ -57,6 +58,13 @@ async function main() {
LSRequiresNativeExecution: true
});
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
// Verify if native module architecture is correct
const findOutput = await spawn('find', [outAppPath, '-name', 'keytar.node'])
const lipoOutput = await spawn('lipo', ['-archs', findOutput.replace(/\n$/, "")]);
if (lipoOutput.replace(/\n$/, "") !== 'x86_64 arm64') {
throw new Error(`Invalid arch, got : ${lipoOutput}`)
}
}
if (require.main === module) {