Skip to content

Commit

Permalink
🚸 Try to search for anvil in standard location
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Oct 6, 2024
1 parent d6165eb commit 88dd403
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion wake/development/chain_interfaces.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from __future__ import annotations

import platform
import subprocess
import time
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from urllib.error import URLError

Expand Down Expand Up @@ -191,7 +193,15 @@ def launch(
args += ["-k", hardfork]

console.print(f"Launching {' '.join(args)}")
process = subprocess.Popen(args, stdout=subprocess.DEVNULL)
try:
process = subprocess.Popen(args, stdout=subprocess.DEVNULL)
except FileNotFoundError:
if args[0] == "anvil" and platform.system() != "Windows":
args[0] = str(Path.home() / ".foundry/bin/anvil")
console.print(f"Launching {' '.join(args)}")
process = subprocess.Popen(args, stdout=subprocess.DEVNULL)
else:
raise

try:
start = time.perf_counter()
Expand Down

0 comments on commit 88dd403

Please sign in to comment.