1.1.0 #2

Merged
sergey merged 6 commits from dev into main 2025-06-18 13:08:13 +00:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit bc27460564 - Show all commits

View File

@ -1,6 +1,7 @@
from git import Repo, InvalidGitRepositoryError, Git
from config import cfg
import logging as log
from datetime import datetime
def check_remote_repo(repo: Repo):
@ -52,15 +53,16 @@ def check_bcp_repo(path: str = cfg.bcp.dir) -> None:
def add_file_and_commit(file_name: str) -> None:
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
repo = Repo(cfg.bcp.dir)
if file_name in repo.untracked_files:
repo.git.add(file_name)
repo.index.commit("add %s %s" % (file_name, current_time))
log.info("%r added in repo", file_name)
repo.index.commit("add file %s" % file_name)
if bool(repo.git.diff(file_name)):
repo.index.add([file_name])
repo.index.commit("update file %s" % file_name)
repo.index.commit("update %s %s" % (file_name, current_time))
log.info("change in %r commited", file_name)
else:
log.info("no changed in file %r", file_name)