Add check for locate binary on system
This commit is contained in:
parent
a22774da5f
commit
eb701afcd3
5
bin/fqo
5
bin/fqo
@ -56,7 +56,12 @@ parser.add_argument("patterns", nargs="+", help="file pattern to search for")
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
try:
|
||||||
files = locate_files(args.patterns)
|
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)
|
selected_file = run_fzf(files)
|
||||||
|
|
||||||
subprocess.run([PACMAN_CMD, "-Qo", selected_file])
|
subprocess.run([PACMAN_CMD, "-Qo", selected_file])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user