Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) Autoupdate on MacOS #839

Merged
merged 3 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"electron-util": "^0.17.2",
"electron-window-state": "^5.0.3",
"env-cmd": "^10.1.0",
"extract-zip": "^2.0.1",
"open": "^7.0.1"
},
"browserslist": {
Expand Down
12 changes: 9 additions & 3 deletions scripts/auto-updater/bfx.mac.updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const path = require('path')
const fs = require('fs')
const { spawn } = require('child_process')
const { MacUpdater } = require('electron-updater')
const extract = require('extract-zip')

const { rootPath: appDir } = require('electron-root-path')
const logger = require('electron-log')
const AdmZip = require('adm-zip')

class BfxMacUpdater extends MacUpdater {
constructor(...args) {
Expand Down Expand Up @@ -56,8 +56,14 @@ class BfxMacUpdater extends MacUpdater {

await fs.promises.rmdir(root, { recursive: true, force: true })

const downloadedZIPFile = new AdmZip(downloadedFilePath)
await downloadedZIPFile.extractAllToAsync(dist, true)
await extract(
downloadedFilePath,
{
dir: dist,
defaultDirMode: '0o777',
dmytroshch marked this conversation as resolved.
Show resolved Hide resolved
defaultFileMode: '0o777',
},
)

if (!isForceRunAfter) {
return true
Expand Down
Loading