From 422ff191552148fb239099f22f60954f155ef122 Mon Sep 17 00:00:00 2001 From: zjgilliam Date: Mon, 23 Sep 2024 09:54:16 -0500 Subject: [PATCH] Automated commit -> added return statement to parser in jatosapi --- jatosAPI.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/jatosAPI.py b/jatosAPI.py index aa65949..9bcc8f0 100644 --- a/jatosAPI.py +++ b/jatosAPI.py @@ -228,15 +228,16 @@ def move_txt(txt_files): - -def push(): - import git - repo = git.Repo('./') - repo.git.add('.') - repo.git.commit('-m', 'new data') - origin = repo.remote(name='origin') - origin.push() - return None +def push(toke): + #use the folder name as task + task = os.path.basename(os.getcwd()) + + subprocess.run(['git', 'config', 'user.email', 'miloswrath@users.noreply.github.com']) + subprocess.run(['git', 'remote', 'set-url', 'origin', f'https://miloswrath:{toke}@github.com/HBClab/{task}']) + subprocess.run(['git', 'config', 'user.name', 'miloswrath']) + subprocess.run(['git', 'add', '.']) + subprocess.run(['git', 'commit', '-m', 'Automated Commit -> New Data']) + subprocess.run(['git', 'push', 'origin', 'main']) def main(): args = parse_cmd()