mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-20 10:15:23 -04:00
Add option to open config in nvim
Signed-off-by: nathom <nathanthomas707@gmail.com>
This commit is contained in:
parent
3907178f5f
commit
11443af6aa
1 changed files with 7 additions and 3 deletions
|
@ -2,11 +2,12 @@
|
|||
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
from getpass import getpass
|
||||
from hashlib import md5
|
||||
|
||||
import click
|
||||
import requests
|
||||
import requests # type: ignore
|
||||
|
||||
from . import __version__
|
||||
from .clients import TidalClient
|
||||
|
@ -279,7 +280,7 @@ def lastfm(ctx, source, url):
|
|||
"-ov",
|
||||
"--open-vim",
|
||||
is_flag=True,
|
||||
help="Open the config file in the vim text editor.",
|
||||
help="Open the config file in the nvim or vim text editor.",
|
||||
)
|
||||
@click.pass_context
|
||||
def config(ctx, **kwargs):
|
||||
|
@ -298,6 +299,9 @@ def config(ctx, **kwargs):
|
|||
click.launch(CONFIG_PATH)
|
||||
|
||||
if kwargs["open_vim"]:
|
||||
if shutil.which("nvim") is not None:
|
||||
os.system(f"nvim '{CONFIG_PATH}'")
|
||||
else:
|
||||
os.system(f"vim '{CONFIG_PATH}'")
|
||||
|
||||
if kwargs["directory"]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue