[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():
|
||||
lst_cmd_git_status = ["git", "status", "--porcelain"]
|
||||
lst_cmd_git_status_repo = [
|
||||
".venv.erplibre/bin/repo",
|
||||
"forall",
|
||||
"-p",
|
||||
"-c",
|
||||
"git status -s",
|
||||
]
|
||||
path_repo_bin = ".venv.erplibre/bin/repo"
|
||||
if os.path.exists(path_repo_bin):
|
||||
lst_cmd_git_status_repo = [
|
||||
path_repo_bin,
|
||||
"forall",
|
||||
"-p",
|
||||
"-c",
|
||||
"git status -s",
|
||||
]
|
||||
else:
|
||||
lst_cmd_git_status_repo = []
|
||||
try:
|
||||
print(" ".join(lst_cmd_git_status))
|
||||
result = subprocess.run(
|
||||
|
|
@ -35,15 +39,18 @@ def get_modified_files():
|
|||
|
||||
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(
|
||||
lst_cmd_git_status_repo,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True,
|
||||
)
|
||||
lines_project = result.stdout.strip().split("\n\n")
|
||||
result = subprocess.run(
|
||||
lst_cmd_git_status_repo,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True,
|
||||
)
|
||||
lines_project = result.stdout.strip().split("\n\n")
|
||||
else:
|
||||
lines_project = []
|
||||
|
||||
if os.path.isfile(".odoo-version"):
|
||||
with open(".odoo-version") as txt:
|
||||
|
|
|
|||
Loading…
Reference in a new issue