Skip to content

Commit

Permalink
Fixed ZIP destination directory for Windows
Browse files Browse the repository at this point in the history
Bumped to 0.0.11.

It's probably just luck, but #2 isn't happening now for me.
  • Loading branch information
adam-lynch committed Aug 23, 2014
1 parent f9e78c7 commit e281927
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions app/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@
pUnpack[platform].apply(this, arguments);
};

/**
* @param zipPath
* @return {string}
*/
var getZipDestinationDirectory = function(zipPath){
return path.join(path.dirname(zipPath), path.basename(zipPath, path.extname(zipPath)));
};

var pUnpack = {
mac: function(filename, cb){
var args = arguments;
Expand Down Expand Up @@ -180,14 +188,16 @@
}
},
win: function(filename, cb){
var destinationDirectory = getZipDestinationDirectory(filename);

// unzip by C. Spieler (docs: https://www.mkssoftware.com/docs/man1/unzip.1.asp, issues: http://www.info-zip.org/)
exec(path.resolve(__dirname, 'tools/unzip.exe') + " -u -o " +
filename + " -d " + os.tmpdir(), function(err){
filename + " -d " + destinationDirectory, function(err){
if(err){
return cb(err);
}
var theName = path.basename(filename, path.extname(filename));
cb(null, path.join(os.tmpdir(), theName, theName + '.exe'));
var basename = path.basename(filename, path.extname(filename));
cb(null, path.join(destinationDirectory, basename + '.exe'));
});
},
linux32: function(filename, cb){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"update",
"autoupdate"
],
"version": "0.0.5",
"version": "0.0.11",
"main": "./app/updater.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit e281927

Please sign in to comment.