Skip to content

Commit

Permalink
refactor: add message at the end of command
Browse files Browse the repository at this point in the history
  • Loading branch information
tecoholic committed Nov 10, 2024
1 parent 6f6eaa2 commit 00565bb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tutor/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ def edit(context: Context) -> None:
config_file = tutor_config.config_path(context.root)

if not os.path.isfile(config_file):
raise exceptions.TutorError(f"Missing config file at {config_file}. Have you run 'tutor local launch' yet?")
raise exceptions.TutorError(
f"Missing config file at {config_file}. Have you run 'tutor local launch' yet?"
)

open_cmd = None

Expand All @@ -278,9 +280,14 @@ def edit(context: Context) -> None:
# The second argument "" just means "don't give the window a custom title".
open_cmd = ["start", '""', config_file]
else:
raise exceptions.TutorError(f"Failed to find utility to launch an editor.")
raise exceptions.TutorError(
f"Failed to find utility to launch an editor. Edit {config_file} with the editor of your choice."
)

subprocess.call(open_cmd)
click.echo(
"Remember to run 'tutor config save' after editing, to apply the changes to your environment."
)


config_command.add_command(save)
Expand Down

0 comments on commit 00565bb

Please sign in to comment.