1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-05 05:17:40 +02:00

make downloaded update executable

This commit is contained in:
Kyle Spearrin 2018-05-22 19:31:29 -04:00
parent 14e5291cae
commit b12783910a

View File

@ -1,5 +1,6 @@
import * as AdmZip from 'adm-zip';
import * as program from 'commander';
import * as fs from 'fs';
import * as fetch from 'node-fetch';
import * as path from 'path';
@ -63,6 +64,9 @@ export class UpdateCommand {
const zip = new AdmZip(zipBuffer);
const currentDir = this.inPkg ? path.dirname(process.execPath) : __dirname;
zip.extractAllTo(currentDir, true);
if (process.platform !== 'win32') {
fs.chmodSync(path.join(currentDir, 'bw'), 764);
}
res.title = 'Updated self to ' + tagName + '.';
if (responseJson.body != null && responseJson.body !== '') {
res.message = responseJson.body;