File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 61
61
- name : Update formula
62
62
if : env.UPDATE_NEEDED == 'true'
63
63
run : |
64
+ # Replace the existing timestamp or add a new one at the top if it doesn't exist
65
+ if grep -q "# Formula last updated on" Formula/fpm.rb; then
66
+ # Replace the existing timestamp line
67
+ sed -i "0,/# Formula last updated on/ c\# Formula last updated on $(date +'%Y-%m-%d %H:%M:%S')" Formula/fpm.rb
68
+ else
69
+ # If no timestamp line exists, add it at the top
70
+ sed -i "1i\# Formula last updated on $(date +'%Y-%m-%d %H:%M:%S')" Formula/fpm.rb
71
+ fi
64
72
sed -i "1s|^|# Formula last updated on $(date +'%Y-%m-%d %H:%M:%S')\n|" Formula/fpm.rb
65
73
sed -i "s|url \".*\"|url \"https://github.com/fortran-lang/fpm/releases/download/${LATEST_VERSION_V}/fpm-${LATEST_VERSION}.zip\"|" Formula/fpm.rb
66
74
sed -i "s|sha256 \".*\"|sha256 \"${SHA256}\"|" Formula/fpm.rb
You can’t perform that action at this time.
0 commit comments