Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nonoroazoro committed May 9, 2018
2 parents dc731d5 + d303962 commit 4fb29da
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelogs

## 1.6.1 - May 10, 2018

- Fixed: Replace `adm-zip` with `extract-zip` to fix a bug on windows, finally!


## 1.6.0 - May 09, 2018

- Added: [Poka-Yoke (Mistake-Proofing)](https://en.wikipedia.org/wiki/Poka-yoke), see [#25](https://github.com/nonoroazoro/vscode-syncing/issues/25) (Thank [@christianmalek](https://github.com/christianmalek) for the advice).
Expand All @@ -15,7 +20,7 @@
## 1.5.2 - December 28, 2017

- Changed: Enhance user guides.
- Fixed: A bug caused by adm-zip on Linux Mint and Xubuntu ([Issue #21](https://github.com/nonoroazoro/vscode-syncing/issues/21)).
- Fixed: A bug caused by `adm-zip` on Linux Mint and Xubuntu ([Issue #21](https://github.com/nonoroazoro/vscode-syncing/issues/21)).


## 1.5.1 - December 04, 2017
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "syncing",
"displayName": "Syncing",
"description": "Sync all of your VSCode settings across multiple devices.",
"version": "1.6.0",
"version": "1.6.1",
"publisher": "nonoroazoro",
"author": {
"email": "[email protected]",
Expand Down Expand Up @@ -95,8 +95,8 @@
},
"dependencies": {
"@octokit/rest": "^15.2.6",
"adm-zip": "^0.4.7",
"async": "^2.6.0",
"extract-zip": "^1.6.6",
"fs-extra": "^5.0.0",
"https-proxy-agent": "^2.2.1",
"jsonc-parser": "^2.0.0",
Expand All @@ -108,8 +108,8 @@
"temp": "^0.8.3"
},
"devDependencies": {
"@types/adm-zip": "^0.4.31",
"@types/async": "^2.0.49",
"@types/extract-zip": "^1.6.2",
"@types/fs-extra": "^5.0.2",
"@types/lodash.pick": "^4.4.3",
"@types/minimatch": "^3.0.3",
Expand Down
49 changes: 24 additions & 25 deletions src/core/Extension.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as AdmZip from "adm-zip";
import * as async from "async";
import * as extractZip from "extract-zip";
import * as fs from "fs";
import * as fse from "fs-extra";
import * as https from "https";
Expand Down Expand Up @@ -279,33 +279,32 @@ export default class Extension
}
else
{
const zip: AdmZip = new AdmZip(extension.zip);
try
extractZip(extension.zip, { dir: dirPath }, (err2) =>
{
zip.extractAllTo(dirPath, true);
}
catch (err2)
{
reject(`Cannot extract extension: ${extension.id}. ${err2.message}`);
return;
}

const extPath = path.join(this._env.extensionsPath, `${extension.publisher}.${extension.name}-${extension.version}`);
fse.emptyDir(extPath)
.then(() =>
{
return fse.copy(path.join(dirPath, "extension"), extPath);
})
.then(() =>
if (err2)
{
// Clear temp file (background and don't wait).
fse.remove(extension.zip!).catch(() => { });
resolve(Object.assign({}, extension, { path: extPath }));
})
.catch((err3) =>
reject(`Cannot extract extension: ${extension.id}. ${err2.message}`);
}
else
{
reject(`Cannot extract extension: ${extension.id}. ${err3.message}`);
});
const extPath = path.join(this._env.extensionsPath, `${extension.publisher}.${extension.name}-${extension.version}`);
fse.emptyDir(extPath)
.then(() =>
{
return fse.copy(path.join(dirPath, "extension"), extPath);
})
.then(() =>
{
// Clear temp file (background and don't wait).
fse.remove(extension.zip!).catch(() => { });
resolve(Object.assign({}, extension, { path: extPath }));
})
.catch((err3) =>
{
reject(`Cannot extract extension: ${extension.id}. ${err3.message}`);
});
}
});
}
});
});
Expand Down

0 comments on commit 4fb29da

Please sign in to comment.