Skip to content

Commit

Permalink
Workaround issue when upgrading from v1.5.9 or older that causes it t…
Browse files Browse the repository at this point in the history
…o use old app files.
  • Loading branch information
HomerSp committed Apr 12, 2021
1 parent 047f976 commit 652432a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ filter = require 'gulp-filter'
Q = require 'q'
Stream = require 'stream'
spawn = require('child_process').spawn
glob = require('glob')

#
#
Expand Down Expand Up @@ -323,6 +324,16 @@ deploy = (platform, arch, cb) ->
console.error(error)
.then (appPaths) ->
if appPaths?.length > 0
# Work around issue when upgrading from an older version that causes
# it to use the old app directory, rather than the new app.asar file.
# This is due to electron checking for the app dir first, then the asar.
# See: https://github.com/electron/electron/blob/master/lib/browser/init.ts#L84
files = glob.sync "#{appPaths[0]}/**/app.asar", {nodir: true}
if files.length > 0
resPath = path.dirname files[0]
fs.mkdirSync "#{resPath}/app", {recursive: true}
fs.writeFileSync "#{resPath}/app/package.json", ""

if process.env.NO_ZIP
cb()
return deferred.resolve()
Expand Down

0 comments on commit 652432a

Please sign in to comment.