File size: 804 Bytes
cb8339d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import os
import subprocess
def git_add_commit_push(file_path):
subprocess.call(['git', 'lfs', 'install'])
# Git add the file
subprocess.call(['git', 'add', file_path])
# Git commit the file
subprocess.call(['git', 'commit', '-m', 'Committing {}'.format(file_path)])
# Git push the changes
subprocess.call(['git', 'push', 'origin', 'main'])
def process_directory(directory_path):
# Walk through the directory
for root, dirs, files in os.walk(directory_path):
for file in files:
file_path = os.path.join(root, file)
git_add_commit_push(file_path)
# Specify the directory you want to process
directory_paths = ['raw', 'processed']
# Process the directory
for directory_path in directory_paths:
process_directory(directory_path)
|