Compare commits
2
Commits
a1a9a7acac
...
8d7fb59d39
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d7fb59d39 | ||
|
|
0df2720f89 |
@@ -50,6 +50,4 @@ SUPPORTED_REMOTE_APIS = [
|
|||||||
|
|
||||||
REPOSITORY_TOKEN_FILENAME = ".repository-token"
|
REPOSITORY_TOKEN_FILENAME = ".repository-token"
|
||||||
|
|
||||||
FLOWCONFIG_FILENAME = ".flowconfig"
|
|
||||||
|
|
||||||
FLOWCONFIG_VERSION = 2
|
FLOWCONFIG_VERSION = 2
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from git_flow import (
|
from git_flow import (
|
||||||
BRANCH_TYPES,
|
BRANCH_TYPES,
|
||||||
REPOSITORY_TOKEN_FILENAME,
|
REPOSITORY_TOKEN_FILENAME,
|
||||||
FLOWCONFIG_FILENAME,
|
|
||||||
FLOWCONFIG_VERSION,
|
FLOWCONFIG_VERSION,
|
||||||
COMMIT_TYPES,
|
COMMIT_TYPES,
|
||||||
GitFlowError,
|
GitFlowError,
|
||||||
@@ -19,7 +18,7 @@ import rich
|
|||||||
import rich.panel
|
import rich.panel
|
||||||
import questionary
|
import questionary
|
||||||
|
|
||||||
flowconfig = Git.get_config(FLOWCONFIG_FILENAME) if isfile(FLOWCONFIG_FILENAME) else {}
|
flowconfig = Git.get_config()
|
||||||
environments = (
|
environments = (
|
||||||
flowconfig["flow.branches"].split(",") if "flow.branches" in flowconfig else []
|
flowconfig["flow.branches"].split(",") if "flow.branches" in flowconfig else []
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
import git_flow.command.base as base
|
import git_flow.command.base as base
|
||||||
from git_flow import FLOWCONFIG_FILENAME, FLOWCONFIG_VERSION, GitFlowError
|
from git_flow import FLOWCONFIG_VERSION, GitFlowError
|
||||||
from git_flow.git import Git
|
from git_flow.git import Git
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer()
|
||||||
@@ -27,9 +27,7 @@ def init():
|
|||||||
flowconfig["flow.remote"] = remote
|
flowconfig["flow.remote"] = remote
|
||||||
flowconfig["flow.remote-type"] = remote_type
|
flowconfig["flow.remote-type"] = remote_type
|
||||||
|
|
||||||
Git.set_config(flowconfig, FLOWCONFIG_FILENAME)
|
Git.set_config(flowconfig)
|
||||||
Git("add", FLOWCONFIG_FILENAME).exec()
|
|
||||||
Git("commit", message="feature: initialize git-flow").exec()
|
|
||||||
|
|
||||||
_ensure_all_flow_branches_exist(branches, remote)
|
_ensure_all_flow_branches_exist(branches, remote)
|
||||||
|
|
||||||
|
|||||||
+1
-6
@@ -1,6 +1,5 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from git_flow import FLOWCONFIG_FILENAME
|
|
||||||
from git_flow.io import *
|
from git_flow.io import *
|
||||||
|
|
||||||
|
|
||||||
@@ -33,11 +32,7 @@ class Git:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def set_config(config: dict[str, str], file: str | None = None):
|
def set_config(config: dict[str, str], file: str | None = None):
|
||||||
for key, value in config.items():
|
for key, value in config.items():
|
||||||
Git("config", key, value, file=file).exec()
|
Git("config", key, value, file=file).exec(print="Updating config")
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def flow_config(*args, **kwargs):
|
|
||||||
return Git("config", *args, file=FLOWCONFIG_FILENAME, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_current_branch():
|
def get_current_branch():
|
||||||
|
|||||||
Reference in New Issue
Block a user