Skip to content

Commit

Permalink
fix: editor fails to open on mac, fixes #275
Browse files Browse the repository at this point in the history
  • Loading branch information
THEGOLDENPRO committed Apr 3, 2024
1 parent e4b3f26 commit 6f9946d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mov_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .scraper import *
from .download import *

__version__ = "4.2.8"
__version__ = "4.2.9"
12 changes: 11 additions & 1 deletion mov_cli/cli/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
from ..config import Config

import os
from subprocess import check_call, CalledProcessError

from .. import utils
from ..logger import mov_cli_logger

__all__ = (
"set_cli_config",
Expand Down Expand Up @@ -60,4 +62,12 @@ def open_config_file(config: Config):
elif platform == "Linux" or platform == "Android":
editor = "nano"

os.system(f"{editor} {config.config_path}")
mov_cli_logger.debug("Opening config file...")

try:
check_call([editor, config.config_path])
except (FileNotFoundError, CalledProcessError) as e:
mov_cli_logger.error(
f"Failed to open config file with the editor '{editor}'! Error: {e}" \
f"\nYou can manually edit it over here: '{config.config_path}'."
)

0 comments on commit 6f9946d

Please sign in to comment.