From 1eea8b4f96e5a3c696a0a8974ea016af7632cbd0 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Wed, 11 Sep 2024 14:36:28 +0800 Subject: [PATCH] throw error if anvil not found --- .github/workflows/run.yml | 4 ++-- packages/tasks/src/localnet.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 89e76fe..d2899d6 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -22,8 +22,8 @@ jobs: node-version: "21" registry-url: "https://registry.npmjs.org" - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + # - name: Install Foundry + # uses: foundry-rs/foundry-toolchain@v1 - name: Install Dependencies run: yarn diff --git a/packages/tasks/src/localnet.ts b/packages/tasks/src/localnet.ts index 7059d04..281932e 100644 --- a/packages/tasks/src/localnet.ts +++ b/packages/tasks/src/localnet.ts @@ -46,6 +46,17 @@ const killProcessOnPort = async (port: number, forceKill: boolean) => { }; const localnet = async (args: any) => { + try { + execSync("which anvil"); + } catch (error) { + console.error( + ansis.red( + "Error: 'anvil' not found. Please install Foundry: https://getfoundry.sh" + ) + ); + process.exit(1); + } + await killProcessOnPort(args.port, args.forceKill); if (args.anvil !== "")