fix: throw if directory exsists
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
# standard import
|
||||
import logging
|
||||
|
||||
import os
|
||||
|
||||
from chainlib.cli.config import Config
|
||||
|
||||
@@ -66,13 +66,17 @@ def execute(
|
||||
if wallet_keystore:
|
||||
config.add(wallet_keystore, "WALLET_KEY_FILE", exists_ok=True)
|
||||
|
||||
if not skip_gen:
|
||||
if skip_gen:
|
||||
contract = load_contract(directory)
|
||||
else:
|
||||
if os.path.exists(directory):
|
||||
raise Exception(f"Directory {directory} already exists")
|
||||
if csv_file:
|
||||
print(f"Generating from csv:{csv_file} to {directory}")
|
||||
contract = load_contract_from_csv(config, directory, csv_file)
|
||||
else:
|
||||
print("Using Interactive Mode")
|
||||
contract = generate_contract(directory, [target], config, interactive=True)
|
||||
else:
|
||||
contract = load_contract(directory)
|
||||
|
||||
print(contract)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user