From ae8f42e6aca04e626829bfb910eb22baf713cbd1 Mon Sep 17 00:00:00 2001 From: shamangeorge Date: Thu, 20 May 2021 19:46:23 +0300 Subject: [PATCH] feat: allow the remote dotfiles to be fetched from a branch. --- pre_commit/avlos/constants.py | 1 + pre_commit/avlos/install_uninstall.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pre_commit/avlos/constants.py b/pre_commit/avlos/constants.py index 22506c6d..42adb68e 100644 --- a/pre_commit/avlos/constants.py +++ b/pre_commit/avlos/constants.py @@ -4,3 +4,4 @@ HOME_DIRECTORY = str(Path.home()) CONFIG_FILE = '.pre-commit-config.yaml' DEFAULT_CONFIG_FILE = HOME_DIRECTORY + '/' + CONFIG_FILE GITHUB_DOTFILES_REPOSITORY = 'https://github.com/avlos/dotfiles/' +GITHUB_DOTFILES_REPOSITORY_BRANCH = 'some_branch_to_get_from_command_flag_for_development' diff --git a/pre_commit/avlos/install_uninstall.py b/pre_commit/avlos/install_uninstall.py index 7221b65b..38e7666e 100644 --- a/pre_commit/avlos/install_uninstall.py +++ b/pre_commit/avlos/install_uninstall.py @@ -22,6 +22,7 @@ from pre_commit.commands.install_uninstall import _hook_paths from pathlib import Path from git.repo.base import Repo from pre_commit.avlos.constants import GITHUB_DOTFILES_REPOSITORY +from pre_commit.avlos.constants import GITHUB_DOTFILES_REPOSITORY_BRANCH logger = logging.getLogger(__name__) @@ -42,7 +43,7 @@ def setup_avlos() -> int: # check if folder exists, remove # if os.path.isdir(installation_directory): shutil.rmtree(installation_directory) - Repo.clone_from(GITHUB_DOTFILES_REPOSITORY, installation_directory) + Repo.clone_from(GITHUB_DOTFILES_REPOSITORY, installation_directory, b=GITHUB_DOTFILES_REPOSITORY_BRANCH) ### copy dotfiles to home directory ### dotfiles = os.listdir(installation_directory)