Skip to content

Commit

Permalink
fix #12
Browse files Browse the repository at this point in the history
  • Loading branch information
edjafarov committed Aug 20, 2014
1 parent 0c95d44 commit cff027b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
var pUnpack = {
mac: function(filename, cb){
var args = arguments;
exec('hdiutil unmount ' + filename, function(err){
// just in case if something was wrong during previous mount
exec('hdiutil unmount /Volumes/'+path.basename(filename, '.dmg'), function(err){
exec('hdiutil attach ' + filename + ' -nobrowse', function(err){
if(err) {
if(err.code == 1){
Expand All @@ -112,7 +113,8 @@
var dmgExp = new RegExp(dmg_name + '$');
for (var i=0,l=results.length;i<l;i++) {
if (results[i].match(dmgExp)) {
var fileToRun = path.join(results[i].split("\t").pop(), dmg_name + ".app");
var mountPoint = results[i].split("\t").pop();
var fileToRun = path.join(mountPoint, dmg_name + ".app");
return callback(null, fileToRun);
}
}
Expand Down

0 comments on commit cff027b

Please sign in to comment.