diff --git a/src/git_flow/command/base.py b/src/git_flow/command/base.py index cf58f83..0fb4f71 100644 --- a/src/git_flow/command/base.py +++ b/src/git_flow/command/base.py @@ -31,6 +31,8 @@ TYPE_INFO = 3 class Command(ABC): + flowconfig: dict[str, str] + @abstractmethod def name(self) -> str: pass @@ -43,11 +45,6 @@ class Command(ABC): def run(self, args: Namespace = Namespace()): pass - def __init__(self) -> None: - self.flowconfig = ( - Git.get_config(FLOWCONFIG_FILE) if isfile(FLOWCONFIG_FILE) else {} - ) - def success(self, msg: str): self._print(TYPE_SUCCESS, msg) diff --git a/src/git_flow/main.py b/src/git_flow/main.py index b7c89b8..344df92 100755 --- a/src/git_flow/main.py +++ b/src/git_flow/main.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os +from os.path import isfile import sys import datetime import requests @@ -15,7 +16,7 @@ from git_flow.command.init import InitCommand from git_flow.command.merge import MergeCommand from git_flow.command.new import NewCommand from git_flow.command.tag import TagCommand -from git_flow.git import BUMP_VERSION, Git +from git_flow.git import BUMP_VERSION, FLOWCONFIG_FILE, Git from git_flow.io import * @@ -54,6 +55,7 @@ class GitFlowCommand(Command): for command in self.commands: if command.name() == args.command: + command.flowconfig = Git.get_config(FLOWCONFIG_FILE) if isfile(FLOWCONFIG_FILE) else {} return command.run(args)