Check for KeyboardInterrupt

This commit is contained in:
Eric Torres 2019-04-17 18:55:51 -07:00
parent 61250fed0d
commit f2a45a7ca3

View File

@ -19,6 +19,7 @@ BOOT_DIR = "/boot"
ETC_DIR = "/etc" ETC_DIR = "/etc"
# ----- Exit Codes ----- # ----- Exit Codes -----
E_INTERRUPT = 1
E_NOEDITORFOUND = 2 E_NOEDITORFOUND = 2
E_NOFILESELECTED = 3 E_NOFILESELECTED = 3
@ -200,7 +201,10 @@ if __name__ == "__main__":
else locate_files(args.patterns) else locate_files(args.patterns)
) )
selected_file = run_fzf(files) try:
selected_file = run_fzf(files)
except KeyboardInterrupt:
exit(E_INTERRUPT)
if selected_file != "": if selected_file != "":
cmd = gen_editor_cmd(selected_file) cmd = gen_editor_cmd(selected_file)