diff --git a/README.md b/README.md index 4ebc280..a49b311 100644 --- a/README.md +++ b/README.md @@ -433,21 +433,21 @@ python configure.py --clean --pyqt6 If no changes are being made to the icons or stylesheets, you may want to ensure that the `dist` directory is assumed to be unchanged in git, no longer tracking changes to these files. You can turn tracking distribution files off with: ```bash -python git.py --no-track-dist +python vcs.py --no-track-dist ``` To turn back on tracking, run: ```bash -python git.py --track-dist +python vcs.py --track-dist ``` ## Git Ignore -Note that the `.gitignore` is auto-generated via `git.py`, and the scripts to track or untrack distribution files turn off `.gitignore` tracking. Any changes should be made in `git.py`, and ensure that `.gitignore` is tracked, and commit any changes: +Note that the `.gitignore` is auto-generated via `vcs.py`, and the scripts to track or untrack distribution files turn off `.gitignore` tracking. Any changes should be made in `vcs.py`, and ensure that `.gitignore` is tracked, and commit any changes: ```bash -python git.py --track-gitignore +python vcs.py --track-gitignore git add .gitignore git commit -m "..." ``` diff --git a/git.py b/vcs.py similarity index 93% rename from git.py rename to vcs.py index b179329..ca896c0 100644 --- a/git.py +++ b/vcs.py @@ -1,5 +1,5 @@ ''' - git + vcs === Track/untrack distribution files. @@ -8,7 +8,6 @@ __version__ = '0.1.0' import argparse -import contextlib import errno import os import shutil @@ -66,18 +65,6 @@ def parse_args(argv=None): return parser.parse_args(argv) -@contextlib.contextmanager -def cd_root(): - '''Temporarily go to the root directory.''' - - cwd = os.getcwd() - try: - os.chdir('/') - yield - finally: - os.chdir(cwd) - - def call(command): '''Call subprocess command (ignoring output but checking code).''' @@ -133,8 +120,7 @@ def main(argv=None): # Find our git executable. Go to the in case on # Windows `.py` is added to valid suffixes so # we don't recursively call this file. - with cd_root(): - git = shutil.which('git') + git = shutil.which('git') if git is None: raise FileNotFoundError(errno.ENOENT, "No such file or directory: 'git'")