cyclops-infobook-html 5.2.1 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,7 +52,6 @@ const fs = __importStar(require("node:fs"));
|
|
|
52
52
|
const Path = __importStar(require("node:path"));
|
|
53
53
|
const node_path_1 = require("node:path");
|
|
54
54
|
const node_util_1 = require("node:util");
|
|
55
|
-
const mvn_artifact_download_1 = __importDefault(require("mvn-artifact-download"));
|
|
56
55
|
const ncp_1 = require("ncp");
|
|
57
56
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
58
57
|
const rimraf_1 = __importDefault(require("rimraf"));
|
|
@@ -170,14 +169,7 @@ class ModLoader {
|
|
|
170
169
|
}
|
|
171
170
|
else if (mod.type === 'maven') {
|
|
172
171
|
process.stdout.write(` - ${mod.artifact} from ${mod.repo}...\n`);
|
|
173
|
-
|
|
174
|
-
if (mod.headers && Object.keys(mod.headers).length > 0) {
|
|
175
|
-
// Authenticated download: construct URL manually and use fetch with headers
|
|
176
|
-
name = yield this.downloadMavenArtifact(mod.artifact, mod.repo, modsDir, mod.headers);
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
name = yield (0, mvn_artifact_download_1.default)(mod.artifact, modsDir, mod.repo);
|
|
180
|
-
}
|
|
172
|
+
const name = yield this.downloadMavenArtifact(mod.artifact, mod.repo, modsDir, mod.headers);
|
|
181
173
|
// Rename file if needed
|
|
182
174
|
if ('name' in mod) {
|
|
183
175
|
fs.renameSync(name, (0, node_path_1.join)(modsDir, mod.name));
|
|
@@ -20,7 +20,7 @@ const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
|
20
20
|
const xml2js_1 = require("xml2js");
|
|
21
21
|
const parseStringPromise = (0, node_util_1.promisify)(xml2js_1.parseString);
|
|
22
22
|
/** Default Maven repository URL, used when no settings.xml is provided. */
|
|
23
|
-
const DEFAULT_MAVEN_REPO = 'https://repo.maven.apache.org/maven2';
|
|
23
|
+
const DEFAULT_MAVEN_REPO = 'https://repo.maven.apache.org/maven2/';
|
|
24
24
|
/**
|
|
25
25
|
* Build the URL for a Maven artifact JAR in a repository.
|
|
26
26
|
*/
|
|
@@ -120,7 +120,8 @@ function convertPomToModpack(pomXml, settingsXml) {
|
|
|
120
120
|
if ((_g = (_f = profile.repositories) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.repository) {
|
|
121
121
|
for (const repo of profile.repositories[0].repository) {
|
|
122
122
|
const repoId = repo.id[0];
|
|
123
|
-
const
|
|
123
|
+
const rawUrl = repo.url[0];
|
|
124
|
+
const repoUrl = rawUrl.endsWith('/') ? rawUrl : `${rawUrl}/`;
|
|
124
125
|
repoMap.set(repoId, { id: repoId, url: repoUrl });
|
|
125
126
|
}
|
|
126
127
|
}
|