Comparing version 1.0.0 to 1.0.1
@@ -448,3 +448,2 @@ var Utils; | ||
console.log(error.message); | ||
Cache.save(); | ||
return; | ||
@@ -470,14 +469,38 @@ } | ||
Loader.downloadFiles = downloadFiles; | ||
function getEntryName(entry) { | ||
var entryName = entry.entryName.toString(); | ||
if (entryName.substr(0, 8) == "__MACOSX" || entryName.substr(entryName.length - 9, 9) == ".DS_Store") { | ||
return ""; | ||
} | ||
return entryName; | ||
} | ||
function unzipFile(filePath, dir) { | ||
console.log("unzip... " + filePath); | ||
var zip = new AdmZip(filePath); | ||
for (var _i = 0, _a = zip.getEntries(); _i < _a.length; _i++) { | ||
var entry = _a[_i]; | ||
var entryName = entry.entryName.toString(); | ||
if (entryName.substr(0, 8) == "__MACOSX" || entryName.substr(entryName.length - 9, 9) == ".DS_Store") { | ||
var entries = zip.getEntries(); | ||
var rootNames = []; | ||
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | ||
var entry = entries_1[_i]; | ||
var entryName = getEntryName(entry); | ||
if (!entryName) { | ||
continue; | ||
} | ||
var name_1 = entryName.split("\\").join("/").split("/")[0]; | ||
if (rootNames.indexOf(name_1) == -1) { | ||
rootNames.push(name_1); | ||
} | ||
} | ||
for (var _a = 0, rootNames_1 = rootNames; _a < rootNames_1.length; _a++) { | ||
var name_2 = rootNames_1[_a]; | ||
var targetPath = path.resolve(dir, name_2); | ||
Utils.deletePath(targetPath); | ||
} | ||
for (var _b = 0, entries_2 = entries; _b < entries_2.length; _b++) { | ||
var entry = entries_2[_b]; | ||
var entryName = getEntryName(entry); | ||
if (!entryName) { | ||
continue; | ||
} | ||
var targetPath = path.resolve(dir, entryName); | ||
if (entry.isDirectory) { | ||
Utils.deletePath(targetPath); | ||
Utils.createDirectory(targetPath); | ||
@@ -488,4 +511,5 @@ continue; | ||
if (!content) { | ||
console.log("Cannot unzip file:" + filePath); | ||
break; | ||
readLine.moveCursor(process.stderr, 0, -1); | ||
readLine.clearScreenDown(process.stderr); | ||
throw new Error("Cannot unzip file:" + filePath); | ||
} | ||
@@ -528,2 +552,7 @@ Utils.writeFileTo(targetPath, content, true); | ||
var request = httpClient.get(url, function (response) { | ||
if (response.statusCode >= 400 || response.statusCode == 0) { | ||
file.close(); | ||
outputError = new Error("Cannot download file : " + response.statusMessage); | ||
return; | ||
} | ||
var length = parseInt(response.headers['content-length'], 10); | ||
@@ -564,4 +593,3 @@ var bar = new ProgressBar(':bar [ :percent | :current/:total | :etas ] ', { | ||
var path = require("path"); | ||
var CHARSET = "utf-8"; | ||
var VERSION = "1.0.0"; | ||
var VERSION = "1.0.1"; | ||
function run(args) { | ||
@@ -568,0 +596,0 @@ var commandOptions = CommandLine.parse(args); |
{ | ||
"name": "depsync", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Dom Chen", | ||
@@ -5,0 +5,0 @@ "homepage": "http://www.idom.me/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
28448
660
0