Skip to content

Commit

Permalink
misc: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
himkt committed Mar 26, 2024
1 parent d26c143 commit d6ffdce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/tips
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ def init_tips(args: argparse.Namespace) -> None:

def edit_tips(args: argparse.Namespace) -> None:
tips_file = tips_home() / args.name / "tips"
if not tips_file.exists():
print(f"No tips available for {args.name}")
return
EDITOR = os.environ.get("EDITOR", "vim")
call([EDITOR, tips_file.as_posix()])
print(f"Tips for {args.name} updated.")


def main(args: argparse.Namespace) -> None:
if not tips_home().exists():
print(f"No tips.d found on {tips_home().parent}")
print(f"No tips.d found on {tips_home().parent}.")
return

actions = {
Expand Down

0 comments on commit d6ffdce

Please sign in to comment.