askrobots / askrobots_commitgen
Public
AI-Powered Git Commit Message Generator
danq9
Create commit message adjusting OpenAI initialization and error handling.
c0d2e25
2 years, 6 months ago
History
show_py_files.sh · 515 bytes · 22 lines
| 1 | #!/bin/bash |
| 2 | |
| 3 | # Function to display file contents with timestamp |
| 4 | display_file_contents() { |
| 5 | echo "File: $1" |
| 6 | echo "Last Modified: $(date -r $1)" |
| 7 | echo "----------------" |
| 8 | cat "$1" |
| 9 | echo |
| 10 | echo |
| 11 | } |
| 12 | |
| 13 | if [ "$1" == "--recent" ]; then |
| 14 | # Display the most recently modified .py file |
| 15 | recent_file=$(ls -t *.py | head -n 1) |
| 16 | display_file_contents "$recent_file" |
| 17 | else |
| 18 | # Loop through each .py file in the current directory |
| 19 | for file in *.py; do |
| 20 | display_file_contents "$file" |
| 21 | done |
| 22 | fi |