mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Move download name construction to os installer function
This commit is contained in:
parent
fd559cfc63
commit
079e4893b1
2 changed files with 5 additions and 11 deletions
|
|
@ -4,19 +4,12 @@ import fetch from "make-fetch-happen";
|
||||||
|
|
||||||
const ULTIMATE_VERSION = "v0.2.0";
|
const ULTIMATE_VERSION = "v0.2.0";
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {"windows"} Platform
|
|
||||||
* @typedef {"amd64" | "arm64"} Architecture
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the download URL for the SafeChain Agent installer.
|
* Builds the download URL for the SafeChain Agent installer.
|
||||||
* @param {Platform} platform
|
* @param {string} fileName
|
||||||
* @param {Architecture} architecture
|
|
||||||
*/
|
*/
|
||||||
export function getAgentDownloadUrl(platform, architecture) {
|
export function getAgentDownloadUrl(fileName) {
|
||||||
const extension = platform === "windows" ? "msi" : "pkg";
|
return `https://github.com/AikidoSec/safechain-internals/releases/download/${ULTIMATE_VERSION}/${fileName}`;
|
||||||
return `https://github.com/AikidoSec/safechain-internals/releases/download/${ULTIMATE_VERSION}/SafeChainAgent-${platform}-${architecture}.${extension}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@ export async function installOnWindows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const architecture = getWindowsArchitecture();
|
const architecture = getWindowsArchitecture();
|
||||||
const downloadUrl = getAgentDownloadUrl("windows", architecture);
|
const fileName = `SafeChainAgent-windows-${architecture}.msi`;
|
||||||
|
const downloadUrl = getAgentDownloadUrl(fileName);
|
||||||
const msiPath = join(tmpdir(), `SafeChainAgent-${Date.now()}.msi`);
|
const msiPath = join(tmpdir(), `SafeChainAgent-${Date.now()}.msi`);
|
||||||
|
|
||||||
ui.emptyLine();
|
ui.emptyLine();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue