1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-31 22:51:28 +01:00

fixes for mas task

This commit is contained in:
Kyle Spearrin 2019-09-27 21:18:57 -04:00
parent e886a9d6aa
commit ddc0819434

View File

@ -44,18 +44,16 @@ function pkgMas(cb) {
const safariAppexFrameworkPath = safariAppexPath + '/Contents/Frameworks/'; const safariAppexFrameworkPath = safariAppexPath + '/Contents/Frameworks/';
const safariEntitlementsPath = paths.resources + 'safari.entitlements'; const safariEntitlementsPath = paths.resources + 'safari.entitlements';
return del([paths.dist + 'Bitwarden*.pkg']) return del([paths.dist + 'mas/Bitwarden*.pkg'])
.then(() => { .then(() => {
const libs = fs.readdirSync(safariAppexFrameworkPath).filter((p) => p.endsWith('.dylib')) const libs = fs.readdirSync(safariAppexFrameworkPath).filter((p) => p.endsWith('.dylib'))
.map((p) => builtAppexFrameworkPath + p); .map((p) => safariAppexFrameworkPath + p);
const allItems = libs.concat([safariAppexPath]); const allItems = libs.concat([safariAppexPath]);
const promises = []; const promises = [];
allItems.forEach((i) => { allItems.forEach((i) => {
const proc = child.spawn('codesign', [ const proc = child.spawn('codesign', [
'--verbose', '--verbose',
'--force', '--force',
'-o',
'runtime',
'--sign', '--sign',
'3rd Party Mac Developer Application: 8bit Solutions LLC', '3rd Party Mac Developer Application: 8bit Solutions LLC',
'--entitlements', '--entitlements',
@ -66,20 +64,13 @@ function pkgMas(cb) {
}); });
return Promise.all(promises); return Promise.all(promises);
}).then(() => { }).then(() => {
const libs = fs.readdirSync(safariAppexFrameworkPath).filter((p) => p.endsWith('.dylib')) const proc = child.spawn('productbuild', [
.map((p) => builtAppexFrameworkPath + p); '--component',
const allItems = libs.concat([safariAppexPath]); appPath,
const promises = []; '/Applications',
allItems.forEach((i) => { pkgPath]);
const proc = child.spawn('productbuild', [ stdOutProc(proc);
'--component', return new Promise((resolve) => proc.on('close', resolve));
appPath,
'/Applications',
pkgPath]);
stdOutProc(proc);
promises.push(new Promise((resolve) => proc.on('close', resolve)));
});
return Promise.all(promises);
}).then(() => { }).then(() => {
return cb; return cb;
}, () => { }, () => {