From 216e9dc0ba12c44a1bc5b69d9c3e456a197b1765 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 27 Sep 2019 23:36:31 -0400 Subject: [PATCH] remove start artifact script --- scripts/start-artifact.js | 52 --------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 scripts/start-artifact.js diff --git a/scripts/start-artifact.js b/scripts/start-artifact.js deleted file mode 100644 index 418bcde5d8..0000000000 --- a/scripts/start-artifact.js +++ /dev/null @@ -1,52 +0,0 @@ -const fs = require('fs'); -const child = require('child_process'); - -exports.default = run; - -async function run(context) { - console.log('### Start artifact'); - // console.log(context); - - const appName = context.packager.appInfo.productFilename; - const appPath = `${context.appOutDir}/${appName}.app`; - const masBuild = context.electronPlatformName === 'mas'; - const macBuild = context.electronPlatformName === 'darwin'; - - if (masBuild || macBuild) { - console.log('### Signing Safari App Extension Libs'); - const resourcesPath = context.packager.info._buildResourcesDir; - const devId = masBuild ? '3rd Party Mac Developer Application: 8bit Solutions LLC' : - 'Developer ID Application: 8bit Solutions LLC'; - await signSafariAppLibs(appPath, resourcesPath, devId); - } -} - -async function signSafariAppLibs(appPath, resourcesPath, devId) { - const appexPath = appPath + '/Contents/PlugIns/safari.appex'; - const appexFrameworkPath = appexPath + '/Contents/Frameworks/'; - const entitlementsPath = resourcesPath + '/safari.entitlements'; - - const libs = fs.readdirSync(appexFrameworkPath).filter((p) => p.endsWith('.dylib')) - .map((p) => appexFrameworkPath + p); - const promises = []; - libs.forEach((i) => { - const proc = child.spawn('codesign', [ - '--verbose', - '--force', - '-o', - 'runtime', - '--sign', - devId, - '--entitlements', - entitlementsPath, - i]); - stdOutProc(proc); - promises.push(new Promise((resolve) => proc.on('close', resolve))); - }); - await Promise.all(promises); -} - -function stdOutProc(proc) { - proc.stdout.on('data', (data) => console.log(data.toString())); - proc.stderr.on('data', (data) => console.error(data.toString())); -}