More work on package processing robustness
This commit is contained in:
parent
3de429ae6a
commit
62815fe2b5
|
@ -192,6 +192,7 @@ public class NpmPackage {
|
||||||
try {
|
try {
|
||||||
res.readIndexFile((JsonObject) JsonTrackingParser.parseJson(new String(res.content.get("package/.index.json"))));
|
res.readIndexFile((JsonObject) JsonTrackingParser.parseJson(new String(res.content.get("package/.index.json"))));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
TextFile.bytesToFile(res.content.get("package/.index.json"), "c:\\temp\\.index.json");
|
||||||
throw new IOException("Error parsing package/.index.json: "+e.getMessage(), e);
|
throw new IOException("Error parsing package/.index.json: "+e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -565,7 +565,6 @@ public class PackageCacheManager {
|
||||||
if (progress)
|
if (progress)
|
||||||
System.out.println(" done.");
|
System.out.println(" done.");
|
||||||
|
|
||||||
//todo: load dependencies
|
|
||||||
NpmPackage pck = loadPackageInfo(packRoot);
|
NpmPackage pck = loadPackageInfo(packRoot);
|
||||||
if (!id.equals(JSONUtil.str(npm.getNpm(), "name")) || !version.equals(JSONUtil.str(npm.getNpm(), "version"))) {
|
if (!id.equals(JSONUtil.str(npm.getNpm(), "name")) || !version.equals(JSONUtil.str(npm.getNpm(), "version"))) {
|
||||||
if (!id.equals(JSONUtil.str(npm.getNpm(), "name"))) {
|
if (!id.equals(JSONUtil.str(npm.getNpm(), "name"))) {
|
||||||
|
|
|
@ -370,7 +370,7 @@ public class JsonTrackingParser {
|
||||||
JsonTrackingParser self = new JsonTrackingParser();
|
JsonTrackingParser self = new JsonTrackingParser();
|
||||||
self.map = map;
|
self.map = map;
|
||||||
self.setErrorOnDuplicates(!allowDuplicates);
|
self.setErrorOnDuplicates(!allowDuplicates);
|
||||||
return self.parse(source);
|
return self.parse(Utilities.stripBOM(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
private JsonObject parse(String source) throws IOException {
|
private JsonObject parse(String source) throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue