Skip to content

Commit

Permalink
working on git push functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Zbuddy13 committed Sep 7, 2024
1 parent 5ca6bca commit 6781a04
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions modules/github.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import os
from git import Repo
import modules.config as config
import modules.time as t

# Gives the location of the YAML Configuration File
location = os.environ.get("config", "config.yaml")
# Set yaml config as conf
conf = config.importConfig(location)
def gitCommit(location, token):
repo = Repo(location)
os.chdir(location)
backups = os.listdir(location)
commit_message = "Backup on "+str(t.getTime())
repo.index.add(backups)
repo.index.commit(commit_message)
origin = repo.remote('origin')
origin.push()

def setDir(location):
repo = Repo(location)

0 comments on commit 6781a04

Please sign in to comment.