From 27fb39a2936cbb42939739edf404581740a48758 Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Mon, 25 Jul 2022 21:54:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20ganache:=20allow=20local=20insta?= =?UTF-8?q?llation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etheno/ganache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etheno/ganache.py b/etheno/ganache.py index 9446c36..54eef9f 100644 --- a/etheno/ganache.py +++ b/etheno/ganache.py @@ -19,6 +19,8 @@ def __init__(self, cmd=None, args=None, port=8546): if cmd is not None: cmd = shlex.split(cmd) else: + if shutil.which("ganache-cli") is None: + raise ValueError("`ganache-cli` is not installed! Install it by running `npm -g i ganache-cli`") cmd = ['/usr/bin/env', 'ganache-cli'] if args is None: args = [] @@ -29,8 +31,6 @@ def __init__(self, cmd=None, args=None, port=8546): def start(self): if self.ganache: return - if shutil.which("ganache-cli") is None: - raise ValueError("`ganache-cli` is not installed! Install it by running `npm -g i ganache-cli`") if self._client: self.ganache = PtyLogger(self._client.logger, self.args) self.ganache.start()