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()