Skip to content

Commit 47791e5

Browse files
committed
chore: escape / character in variant name
1 parent 7858bb2 commit 47791e5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ const tags = {
1515
};
1616

1717
(async () => {
18+
const escapedVariant = variant.replace("/", "_");
1819
try {
19-
const url = `https://github.com/nginxui/musl-cross-compilers/releases/download/${tags[variant]}/output-${target}-${variant.replace(
20-
"/",
21-
"_"
22-
)}.tar.zst`;
20+
const url = `https://github.com/nginxui/musl-cross-compilers/releases/download/${tags[variant]}/output-${target}-${escapedVariant}.tar.zst`;
2321

2422
let cachedPath;
2523
if (build) {
@@ -70,14 +68,14 @@ const tags = {
7068
}
7169
cachedPath = destDir;
7270
} else {
73-
cachedPath = tc.find("mcm", `${target}-${variant}.tar.zst`);
71+
cachedPath = tc.find("mcm", `${target}-${escapedVariant}.tar.zst`);
7472
}
7573
if (cachedPath) {
7674
console.log(`Found installation at ${cachedPath}`);
7775
} else {
7876
const toolchainPath = await tc.downloadTool(url);
7977
const toolchainExtractedFolder = await tc.extractTar(toolchainPath, undefined, "ax");
80-
cachedPath = await tc.cacheDir(toolchainExtractedFolder, "mcm", `${target}-${variant}.tar.zst`);
78+
cachedPath = await tc.cacheDir(toolchainExtractedFolder, "mcm", `${target}-${escapedVariant}.tar.zst`);
8179
console.log(`Installed at ${cachedPath}`);
8280
}
8381
cachedPath = path.join(cachedPath, "output", "bin");
@@ -90,7 +88,7 @@ const tags = {
9088
await exec.exec("tar", ["-I", "zstdmt", "-cf", "/opt/mcm.tar.zst", buildDir]);
9189
const artifact = require("@actions/artifact");
9290
const artifactClient = artifact.create();
93-
const artifactName = `musl-cross-compiler-error-${target}-${variant.replace("/", "_")}`;
91+
const artifactName = `musl-cross-compiler-error-${target}-${escapedVariant}`;
9492
const files = ["/opt/mcm.tar.zst"];
9593
const rootDirectory = "/opt/";
9694
const options = {};

0 commit comments

Comments
 (0)