mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-12 15:50:01 -08:00
feat: add --path option that prints config location and exits
This commit is contained in:
@@ -12,12 +12,16 @@ from ..utils.tools import exit_app
|
||||
help="Opens up your fastanime config in your preferred editor",
|
||||
short_help="Edit your config",
|
||||
)
|
||||
def configure():
|
||||
if EDITOR := os.environ.get("EDITOR"):
|
||||
subprocess.run([EDITOR, USER_CONFIG_PATH])
|
||||
exit_app()
|
||||
@click.option("--path", "-p", help="Print the config location and exit", is_flag=True)
|
||||
def configure(path):
|
||||
if path:
|
||||
print(USER_CONFIG_PATH)
|
||||
else:
|
||||
print("$EDITOR environment variable missing :confused:")
|
||||
print("Please Set the $EDITOR environment variable to enable editing of config")
|
||||
|
||||
# create_desktop_shortcut()
|
||||
if EDITOR := os.environ.get("EDITOR"):
|
||||
subprocess.run([EDITOR, USER_CONFIG_PATH])
|
||||
exit_app()
|
||||
else:
|
||||
print("$EDITOR environment variable missing :confused:")
|
||||
print(
|
||||
"Please Set the $EDITOR environment variable to enable editing of config"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user