File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 id : compare
3535 run : |
3636 # Check if any files in _docs/MDhelp/docs are newer than GSASII/help
37+ # Use git log to get actual modification dates from commit history
3738 files_changed="false"
3839
3940 if [ ! -d "GSASII/help" ]; then
4344 echo "docs directory does not exist"
4445 files_changed="false"
4546 else
46- # Compare modification times of files
47+ # Compare git commit dates for files
4748 for doc_file in $(find _docs/MDhelp/docs -type f); do
4849 relative_path="${doc_file#_docs/MDhelp/docs/}"
4950 help_file="GSASII/help/$relative_path"
5455 break
5556 fi
5657
57- # Compare modification times
58- if [ "$doc_file" -nt "$help_file" ]; then
59- echo "File is newer: $relative_path"
58+ # Get git commit dates using git log
59+ doc_commit_date=$(cd _docs && git log -1 --format=%cI -- "MDhelp/docs/$relative_path" 2>/dev/null || echo "")
60+ help_commit_date=$(git log -1 --format=%cI -- "GSASII/help/$relative_path" 2>/dev/null || echo "")
61+
62+ if [ -z "$doc_commit_date" ]; then
63+ echo "Could not get commit date for: $relative_path"
64+ continue
65+ fi
66+
67+ if [ -z "$help_commit_date" ]; then
68+ echo "New file detected: $relative_path"
69+ files_changed="true"
70+ break
71+ fi
72+
73+ # Compare ISO 8601 dates (they sort correctly as strings)
74+ if [ "$doc_commit_date" > "$help_commit_date" ]; then
75+ echo "File is newer in tutorials repo: $relative_path (docs: $doc_commit_date, help: $help_commit_date)"
6076 files_changed="true"
6177 break
6278 fi
You can’t perform that action at this time.
0 commit comments