Skip to content

Commit 6e75327

Browse files
Fix code review issues: remove quotes from git format, improve verification command, auto-detect Python path
Co-authored-by: Lackadaisical-Security <205846242+Lackadaisical-Security@users.noreply.github.com>
1 parent fd35a41 commit 6e75327

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

generate_checksums.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ def main():
9999
f.write(f"| `{file_info['filename']}` | {file_info['size']} | `{file_info['sha256']}` |\n")
100100
f.write("\n## Verification\n\n")
101101
f.write("**Linux/macOS:**\n```bash\n")
102-
f.write("sha256sum -c <(cat FILE_CHECKSUMS.md | grep '|.*\\.json' | awk '{print $6 \" \" $2}')\n")
102+
f.write("# Verify all files\nwhile IFS='|' read -r _ filename _ checksum _; do\n")
103+
f.write(" filename=$(echo $filename | xargs)\n")
104+
f.write(" checksum=$(echo $checksum | xargs)\n")
105+
f.write(" if [[ $filename =~ ^[a-zA-Z] ]]; then\n")
106+
f.write(" echo \"$checksum $filename\" | sha256sum -c\n")
107+
f.write(" fi\n")
108+
f.write("done < <(grep '|.*\\.' FILE_CHECKSUMS.md | tail -n +2)\n")
103109
f.write("```\n\n")
104110
f.write("**Windows PowerShell:**\n```powershell\n")
105111
f.write("Get-FileHash <filename> -Algorithm SHA256\n")

git_activity_tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_git_stats():
2323

2424
# Get contributors
2525
contributors = subprocess.check_output(
26-
["git", "log", "--format='%an'"],
26+
["git", "log", "--format=%an"],
2727
text=True
2828
).strip().split("\n")
2929
unique_contributors = len(set(contributors))

setup_cron_tracker.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ CRON_SCHEDULE="0 */6 * * *" # Every 6 hours
77

88
echo "Setting up cron job for repository stats tracking..."
99

10+
# Detect Python path
11+
PYTHON_PATH=$(which python3 2>/dev/null || echo "/usr/bin/python3")
12+
1013
# Create cron job
11-
(crontab -l 2>/dev/null; echo "${CRON_SCHEDULE} cd ${REPO_DIR} && /usr/bin/python3 realtime_stats_tracker.py &> ${REPO_DIR}/stats_tracker.log 2>&1") | crontab -
14+
(crontab -l 2>/dev/null; echo "${CRON_SCHEDULE} cd ${REPO_DIR} && ${PYTHON_PATH} realtime_stats_tracker.py &> ${REPO_DIR}/stats_tracker.log 2>&1") | crontab -
1215

1316
echo "✅ Cron job created!"
1417
echo " Schedule: Every 6 hours"

0 commit comments

Comments
 (0)