From 9f0832393dd253ec60735b3b6997b1efde39ce07 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Mon, 3 Oct 2022 00:14:20 +0200 Subject: [PATCH] print .env file on info --- cashu/core/settings.py | 1 - cashu/wallet/cli.py | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cashu/core/settings.py b/cashu/core/settings.py index 0767d6e..9acdfdf 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -10,7 +10,6 @@ ENV_FILE = os.path.join(str(Path.home()), ".cashu", ".env") if not os.path.isfile(ENV_FILE): ENV_FILE = os.path.join(os.getcwd(), ".env") if os.path.isfile(ENV_FILE): - logger.info("Using .env: " + ENV_FILE) env.read_env(ENV_FILE) else: env.read_env() diff --git a/cashu/wallet/cli.py b/cashu/wallet/cli.py index 7ab0468..ed2fd02 100755 --- a/cashu/wallet/cli.py +++ b/cashu/wallet/cli.py @@ -20,7 +20,7 @@ from cashu.core.bolt11 import Invoice from cashu.core.helpers import fee_reserve from cashu.core.migrations import migrate_databases from cashu.core.script import * -from cashu.core.settings import CASHU_DIR, DEBUG, LIGHTNING, MINT_URL, VERSION +from cashu.core.settings import CASHU_DIR, DEBUG, LIGHTNING, MINT_URL, VERSION, ENV_FILE from cashu.wallet import migrations from cashu.wallet.crud import get_reserved_proofs from cashu.wallet.wallet import Wallet as Wallet @@ -109,7 +109,7 @@ async def send(ctx, amount: int, lock: str): print("Error: lock has to be at least 22 characters long.") return p2sh = False - if len(lock.split("P2SH:")) == 2: + if lock and len(lock.split("P2SH:")) == 2: p2sh = True wallet: Wallet = ctx.obj["WALLET"] wallet.load_mint() @@ -267,6 +267,8 @@ async def info(ctx): print(f"Version: {VERSION}") print(f"Debug: {DEBUG}") print(f"Cashu dir: {CASHU_DIR}") + if ENV_FILE: + print(f"Settings: {ENV_FILE}") print(f"Wallet: {ctx.obj['WALLET_NAME']}") print(f"Mint URL: {MINT_URL}") return