Skip to content

Commit 4f4a3a2

Browse files
committed
Fix feed parsing
1 parent 3e889b8 commit 4f4a3a2

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/_data/depctrl.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ const checkFileIntegrity = async (feeds) => {
2525
if (!file.delete) {
2626
await limitedWebRequest(file.url, "buffer")
2727
.then((fileResponse) => crypto.createHash('sha1').update(fileResponse).digest('hex'))
28+
.catch((error) => {
29+
console.log(error);
30+
return "";
31+
})
2832
.then((fileHash) => {
2933
file["_validHash"] = (fileHash.toUpperCase() === file.sha1.toUpperCase());
3034
feedHashesValid = feedHashesValid && file["_validHash"];
@@ -103,7 +107,7 @@ function fillTemplateVar(data, repDict = {}, parentKey = "", depth = 0) {
103107
break;
104108
case 3: // Script Information
105109
repDict["namespace"] = parentKey;
106-
repDict["namespacePath"] = parentKey.replace(".", "/");
110+
repDict["namespacePath"] = parentKey.replaceAll(".", "/");
107111
repDict["scriptName"] = data["name"] || "";
108112
break;
109113
case 5: // Version Information
@@ -122,7 +126,7 @@ function fillTemplateVar(data, repDict = {}, parentKey = "", depth = 0) {
122126
repDict["fileBaseUrl"] = repDict["fileBaseUrl"] || "";
123127
// Do template replacement on fileBaseUrl
124128
for (let [repName, repVal] of Object.entries(repDict)) {
125-
data["fileBaseUrl"] = data["fileBaseUrl"].replace("@{" + repName + "}", repVal);
129+
data["fileBaseUrl"] = data["fileBaseUrl"].replaceAll("@{" + repName + "}", repVal);
126130
}
127131
// Write fileBaseUrl back to repDict
128132
repDict["fileBaseUrl"] = data["fileBaseUrl"];
@@ -134,7 +138,7 @@ function fillTemplateVar(data, repDict = {}, parentKey = "", depth = 0) {
134138
case "string":
135139
// Do template replacement
136140
for (let [repName, repVal] of Object.entries(repDict)) {
137-
data[key] = data[key].replace("@{" + repName + "}", repVal);
141+
data[key] = data[key].replaceAll("@{" + repName + "}", repVal);
138142
}
139143
break;
140144
case "object":

0 commit comments

Comments
 (0)