feat: validates config path before loading login info
Adds a check to ensure the provided configuration file path exists and is a valid file before attempting to load login information.
This commit is contained in:
parent
e32063e2ce
commit
0671d49497
7
main.py
7
main.py
|
@ -36,7 +36,12 @@ def display_usage():
|
|||
|
||||
|
||||
def main(opt):
|
||||
login_info = LoginInfo(Path(opt.config_path))
|
||||
config_path = Path(opt.config_path)
|
||||
if not config_path.exists() or not config_path.is_file():
|
||||
print(f"Error: Config path '{config_path}' does not exist or is not a file.")
|
||||
return
|
||||
|
||||
login_info = LoginInfo(config_path)
|
||||
|
||||
driver = get_driver()
|
||||
keep_login_status(driver, login_info)
|
||||
|
|
Loading…
Reference in New Issue