From 2f1d6aa2d26ea51bd038ecb111a8da1e04cf9338 Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 18 Jul 2020 00:12:58 +0000 Subject: [PATCH] check for vcs only if commit enabled --- src/pycalver/cli.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pycalver/cli.py b/src/pycalver/cli.py index 0abd8c5..3fe5b4b 100755 --- a/src/pycalver/cli.py +++ b/src/pycalver/cli.py @@ -214,12 +214,13 @@ def _assert_not_dirty(_vcs: vcs.VCS, filepaths: typ.Set[str], allow_dirty: bool) def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> None: _vcs: typ.Optional[vcs.VCS] - - try: - _vcs = vcs.get_vcs() - except OSError: - log.warning("Version Control System not found, aborting commit.") - _vcs = None + + if cfg.commit: + try: + _vcs = vcs.get_vcs() + except OSError: + log.warning("Version Control System not found, aborting commit.") + _vcs = None filepaths = set(cfg.file_patterns.keys())