From cc5b9b0572211a54f70fb0e46fe6483205bc361f Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 16 Mar 2023 16:26:19 -0400 Subject: [PATCH] refactor(main.py): moved and clarified files for drone --- .github/workflows/updater.yml => .drone.yml | 0 updater/git.py | 17 ----------------- 2 files changed, 17 deletions(-) rename .github/workflows/updater.yml => .drone.yml (100%) delete mode 100644 updater/git.py diff --git a/.github/workflows/updater.yml b/.drone.yml similarity index 100% rename from .github/workflows/updater.yml rename to .drone.yml diff --git a/updater/git.py b/updater/git.py deleted file mode 100644 index 1c74b32..0000000 --- a/updater/git.py +++ /dev/null @@ -1,17 +0,0 @@ -import subprocess - - -user_name = 'Updater Robot' -user_email = 'robot@nowhere.invalid' - - -def add_commit_push(directory: str, message: str): - diff = subprocess.run(['git', 'diff', '--cached', '--exit-code'], capture_output=True, text=True) - if diff.returncode != 0: - status = subprocess.run(['git', 'status'], capture_output=True, text=True) - raise Exception('Unknown staged changes found: {}'.format(status.stdout)) - - subprocess.run(['git', 'add', '--all', directory], check=True) - subprocess.run(['git', '-c', 'user.name={}'.format(user_name), '-c', 'user.email={}'.format(user_email), - 'commit', '--message', message]) - subprocess.run(['git', 'push'])