diff --git a/cashu/core/db.py b/cashu/core/db.py index 2af39e7..5b05af6 100644 --- a/cashu/core/db.py +++ b/cashu/core/db.py @@ -83,7 +83,6 @@ class Database(Compat): self.name = db_name self.db_location = db_location self.db_location_is_url = "://" in self.db_location - if self.db_location_is_url: raise Exception("Remote databases not supported. Use SQLite.") # database_uri = self.db_location diff --git a/cashu/core/settings.py b/cashu/core/settings.py index 9acdfdf..41afa2c 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -19,6 +19,7 @@ if not DEBUG: sys.tracebacklimit = 0 CASHU_DIR = env.str("CASHU_DIR", default=os.path.join(str(Path.home()), ".cashu")) +CASHU_DIR = CASHU_DIR.replace("~", str(Path.home())) assert len(CASHU_DIR), "CASHU_DIR not defined" LIGHTNING = env.bool("LIGHTNING", default=True) diff --git a/cashu/wallet/cli.py b/cashu/wallet/cli.py index c2a0bd1..f29c589 100755 --- a/cashu/wallet/cli.py +++ b/cashu/wallet/cli.py @@ -4,6 +4,7 @@ import asyncio import base64 import json import math +import os import sys from datetime import datetime from functools import wraps @@ -50,7 +51,7 @@ def cli(ctx, host: str, walletname: str): ctx.ensure_object(dict) ctx.obj["HOST"] = host ctx.obj["WALLET_NAME"] = walletname - wallet = Wallet(ctx.obj["HOST"], f"{CASHU_DIR}/{walletname}", walletname) + wallet = Wallet(ctx.obj["HOST"], os.path.join(CASHU_DIR, walletname)) ctx.obj["WALLET"] = wallet asyncio.run(init_wallet(wallet)) pass