mirror of https://github.com/aminya/setup-cpp
fix: support downloading raw binaries
This commit is contained in:
parent
e77708aa48
commit
b957bc4ab8
|
@ -7,14 +7,14 @@ import { tmpdir } from "os"
|
||||||
|
|
||||||
/** A type that describes a package */
|
/** A type that describes a package */
|
||||||
export type PackageInfo = {
|
export type PackageInfo = {
|
||||||
/** url to download the package */
|
/** Url to download the package */
|
||||||
url: string
|
url: string
|
||||||
/** The top folder name once it is extracted. It can be `""` if there is no top folder */
|
/** The top folder name once it is extracted. It can be `""` if there is no top folder */
|
||||||
extractedFolderName: string
|
extractedFolderName: string
|
||||||
/** The relative directory in which the binary is located. It can be `""` if the exe is in the top folder */
|
/** The relative directory in which the binary is located. It can be `""` if the exe is in the top folder */
|
||||||
binRelativeDir: string
|
binRelativeDir: string
|
||||||
/** the function to extract the downloaded archive */
|
/** The function to extract the downloaded archive. It can be `undefined`, if the binary itself is downloaded directly. */
|
||||||
extractFunction: {
|
extractFunction?: {
|
||||||
(url: string, outputPath: string): Promise<string>
|
(url: string, outputPath: string): Promise<string>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ export async function setupBin(
|
||||||
if (!existsSync(workDir)) {
|
if (!existsSync(workDir)) {
|
||||||
await group(`Download and extract ${name}`, async () => {
|
await group(`Download and extract ${name}`, async () => {
|
||||||
const downloaded = await downloadTool(url)
|
const downloaded = await downloadTool(url)
|
||||||
await extractFunction(downloaded, workDir)
|
await extractFunction?.(downloaded, workDir)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue