[FIX] script format: ignore git repo if not installed
This commit is contained in:
parent
9d938494eb
commit
19901ed8b9
1 changed files with 22 additions and 15 deletions
|
|
@ -16,13 +16,17 @@ def execute_shell(cmd):
|
||||||
|
|
||||||
def get_modified_files():
|
def get_modified_files():
|
||||||
lst_cmd_git_status = ["git", "status", "--porcelain"]
|
lst_cmd_git_status = ["git", "status", "--porcelain"]
|
||||||
lst_cmd_git_status_repo = [
|
path_repo_bin = ".venv.erplibre/bin/repo"
|
||||||
".venv.erplibre/bin/repo",
|
if os.path.exists(path_repo_bin):
|
||||||
"forall",
|
lst_cmd_git_status_repo = [
|
||||||
"-p",
|
path_repo_bin,
|
||||||
"-c",
|
"forall",
|
||||||
"git status -s",
|
"-p",
|
||||||
]
|
"-c",
|
||||||
|
"git status -s",
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
lst_cmd_git_status_repo = []
|
||||||
try:
|
try:
|
||||||
print(" ".join(lst_cmd_git_status))
|
print(" ".join(lst_cmd_git_status))
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
|
|
@ -35,15 +39,18 @@ def get_modified_files():
|
||||||
|
|
||||||
lst_lines = [(".", lines_local)]
|
lst_lines = [(".", lines_local)]
|
||||||
|
|
||||||
print(" ".join(lst_cmd_git_status_repo))
|
if lst_cmd_git_status_repo:
|
||||||
|
print(" ".join(lst_cmd_git_status_repo))
|
||||||
|
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
lst_cmd_git_status_repo,
|
lst_cmd_git_status_repo,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
lines_project = result.stdout.strip().split("\n\n")
|
lines_project = result.stdout.strip().split("\n\n")
|
||||||
|
else:
|
||||||
|
lines_project = []
|
||||||
|
|
||||||
if os.path.isfile(".odoo-version"):
|
if os.path.isfile(".odoo-version"):
|
||||||
with open(".odoo-version") as txt:
|
with open(".odoo-version") as txt:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue