From eb701afcd3ea317bbf61312bea7c4b5daf559b73 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Tue, 17 Jan 2023 15:46:41 -0800 Subject: [PATCH] Add check for locate binary on system --- bin/fqo | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/fqo b/bin/fqo index 4f29a74..96f5ddd 100644 --- a/bin/fqo +++ b/bin/fqo @@ -56,7 +56,12 @@ parser.add_argument("patterns", nargs="+", help="file pattern to search for") args = parser.parse_args() -files = locate_files(args.patterns) -selected_file = run_fzf(files) +try: + files = locate_files(args.patterns) +# Locate binary is optional for package, but required for script +except FileNotFoundError: + print("locate binary not found, install and re-run script") +else: + selected_file = run_fzf(files) subprocess.run([PACMAN_CMD, "-Qo", selected_file])