Use default launcher if vim not found (#559)

This commit is contained in:
Nathan Thomas 2024-01-13 22:49:07 -08:00 committed by GitHub
parent 4c210b9e52
commit 8bc87a4b74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -222,8 +222,11 @@ def config_open(ctx, vim):
if vim: if vim:
if shutil.which("nvim") is not None: if shutil.which("nvim") is not None:
subprocess.run(["nvim", config_path]) subprocess.run(["nvim", config_path])
else: elif shutil.which("vim") is not None:
subprocess.run(["vim", config_path]) subprocess.run(["vim", config_path])
else:
logger.error("Could not find nvim or vim. Using default launcher.")
click.launch(config_path)
else: else:
click.launch(config_path) click.launch(config_path)