Skip to content

Commit e56ee3a

Browse files
committed
DB corrections
1 parent 7908096 commit e56ee3a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app/utility/_db_create.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111

1212
def create_db(discord_client, db_name, guild_id):
1313
"""
14-
Cross platform way of init-ing a DB
15-
If testing on a Unix local, you may need to use:
16-
db_path = ((Path.cwd() / db_name) if os.name == 'nt' else Path(f'{pathlib.Path.home()}/app/db/{db_name}'))
14+
Cross-platform way of init-ing a DB
1715
"""
18-
db_path = ((Path.cwd() / db_name) if os.name == 'nt' else Path(f'/app/db/{db_name}'))
16+
db_path = ((Path.cwd() / 'db' / db_name))
17+
1918
log_info(f'Loading Database...{db_path}')
2019

2120
if pathlib.Path(db_path).is_file() is False:

app/utility/_db_functions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
from logs.logger import *
1010
from __main__ import config
1111

12-
db_path = ((Path.cwd() / config["Database_name"])
13-
if os.name == 'nt'
14-
else Path(f'/app/db/{config["Database_name"]}'))
12+
13+
db_path = ((Path.cwd() / 'db' / config['Database_name']))
1514

1615

1716
def see_top_10():

0 commit comments

Comments
 (0)