Skip to content

Commit b724006

Browse files
committed
fix: ensure forge url normalized
1 parent d0e8590 commit b724006

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/installer/forge.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Entry, open } from "@xmcl/unzip";
55
import { createWriteStream } from "fs";
66
import { join } from "path";
77
import { DownloaderOption, installByProfileTask, InstallProfile, InstallProfileOption, LibraryOption, resolveLibraryDownloadUrls } from "./minecraft";
8-
import { downloadFileTask, getIfUpdate, InstallOptions as InstallOptionsBase, UpdatedObject, DefaultDownloader, HasDownloader, normailzeDownloader } from "./util";
8+
import { downloadFileTask, getIfUpdate, InstallOptions as InstallOptionsBase, UpdatedObject, DefaultDownloader, HasDownloader, normailzeDownloader, normalizeArray } from "./util";
99

1010
const { copyFile, ensureDir, ensureFile, unlink, waitStream, writeFile } = futils;
1111

@@ -108,7 +108,7 @@ function installByInstallerTask(version: RequiredVersion, minecraft: MinecraftLo
108108
}
109109
}
110110
})!;
111-
let mavenHost = options.mavenHost ? [...options.mavenHost, DEFAULT_FORGE_MAVEN] : [DEFAULT_FORGE_MAVEN];
111+
let mavenHost = options.mavenHost ? [...normalizeArray(options.mavenHost), DEFAULT_FORGE_MAVEN] : [DEFAULT_FORGE_MAVEN];
112112
let urls = resolveLibraryDownloadUrls(library, { ...options, mavenHost });
113113

114114
context.update(0, 120);
@@ -223,7 +223,7 @@ function installByUniversalTask(version: RequiredVersion, minecraft: MinecraftLo
223223
}
224224
}
225225
})!;
226-
let mavenHost = options.mavenHost ? [...options.mavenHost, DEFAULT_FORGE_MAVEN] : [DEFAULT_FORGE_MAVEN];
226+
let mavenHost = options.mavenHost ? [... normalizeArray(options.mavenHost), DEFAULT_FORGE_MAVEN] : [DEFAULT_FORGE_MAVEN];
227227
let urls = resolveLibraryDownloadUrls(library, { ...options, mavenHost });
228228

229229
await context.execute(Task.create("jar", downloadFileTask({

0 commit comments

Comments
 (0)