-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (19 loc) · 953 Bytes
/
main.py
File metadata and controls
27 lines (19 loc) · 953 Bytes
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
import os
import subprocess
root_dir = '/Users/brianabbott/apps/lscloud/liftstation.cloud'
files = []
def get_file_paths():
for dirpath, dirnames, filenames in os.walk(root_dir):
dirnames[:] = [d for d in dirnames if d != 'node_modules']
for filename in filenames:
if not filename.endswith('.json'):
files.append(os.path.join(dirpath, filename))
def compare_files(file_paths, last_commit_hash, latest_commit_hash):
for file_path in file_paths:
diff = subprocess.run(['git', 'diff', last_commit_hash, latest_commit_hash, '--', file_path],
capture_output=True, text=True, cwd=root_dir)
output_file_path = file_path + '.txt'
with open(output_file_path, 'w') as output_file:
output_file.write(diff.stdout)
get_file_paths()
compare_files(files, '6828394792dfe4ab09787ba9219470df9c82326f', 'e45a979999fb6c54e68cea9bffeb79781b0eb936')