mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-04 02:26:11 +08:00
migrate config file
This commit is contained in:
parent
afd689b23a
commit
60377d65d8
@ -21,7 +21,11 @@ def get_config_path() -> str:
|
||||
data_dir = path.join(working_dir, 'data')
|
||||
if not path.isdir(data_dir):
|
||||
os.makedirs(data_dir)
|
||||
return path.join(data_dir, 'bison.json')
|
||||
old_path = path.join(data_dir, 'hk_reporter.json')
|
||||
new_path = path.join(data_dir, 'bison.json')
|
||||
if os.path.exists(old_path) and not os.path.exists(new_path):
|
||||
os.rename(old_path, new_path)
|
||||
return new_path
|
||||
|
||||
class NoSuchUserException(Exception):
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user