From 9cd4893e3ea23f0ee63af2c001303d39a2e1cf72 Mon Sep 17 00:00:00 2001 From: war-in Date: Wed, 17 Jan 2024 15:36:57 +0100 Subject: [PATCH] download USC --- dist/index.js | 10 ++++++++++ lib/download.js | 9 +++++++++ lib/main.js | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 25c0b1d..7d8ca17 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29963,6 +29963,15 @@ async function findStarknetFoundryDir(extractedPath) { ); } +async function downloadUniversalSierraCompiler() { + const { exec } = __nccwpck_require__(2081); + + const command = + "curl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh"; + + exec(command); +} + ;// CONCATENATED MODULE: ./lib/main.js @@ -29995,6 +30004,7 @@ async function main() { triplet, ); if (!StarknetFoundryPrefix) { + await downloadUniversalSierraCompiler(); const download = await downloadStarknetFoundry( StarknetFoundryRepo, StarknetFoundryVersion, diff --git a/lib/download.js b/lib/download.js index aefa596..00da288 100644 --- a/lib/download.js +++ b/lib/download.js @@ -37,3 +37,12 @@ async function findStarknetFoundryDir(extractedPath) { `could not find Starknet Foundry directory in ${extractedPath}`, ); } + +export async function downloadUniversalSierraCompiler() { + const { exec } = require("child_process"); + + const command = + "curl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh"; + + exec(command); +} diff --git a/lib/main.js b/lib/main.js index 118c155..bc027c5 100644 --- a/lib/main.js +++ b/lib/main.js @@ -3,7 +3,10 @@ import { getFullVersionFromStarknetFoundry, versionWithPrefix, } from "./versions"; -import { downloadStarknetFoundry } from "./download"; +import { + downloadStarknetFoundry, + downloadUniversalSierraCompiler, +} from "./download"; import { getOsTriplet } from "./platform"; import path from "path"; import * as core from "@actions/core"; @@ -33,6 +36,7 @@ export default async function main() { triplet, ); if (!StarknetFoundryPrefix) { + await downloadUniversalSierraCompiler(); const download = await downloadStarknetFoundry( StarknetFoundryRepo, StarknetFoundryVersion,