data dir fix

This commit is contained in:
callebtc
2022-10-03 01:11:44 +02:00
parent 0e24579862
commit cd89321561
3 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

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

View File

@@ -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