Skip to content

Commit 68f74c7

Browse files
committed
try with echo
1 parent b977dfa commit 68f74c7

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

.github/workflows/fpm-version-update.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,9 @@ jobs:
6262
- name: Update formula
6363
if: env.UPDATE_NEEDED == 'true'
6464
run: |
65-
# Replace the existing timestamp or add a new one at the top if it doesn't exist
66-
if grep -q "# Formula last updated on" Formula/fpm.rb; then
67-
# Replace the existing timestamp line
68-
sed -i "0,/# Formula last updated on/ c\# Formula last updated on $(date +'%Y-%m-%d %H:%M:%S')" Formula/fpm.rb
69-
else
70-
# If no timestamp line exists, add it at the top
71-
sed -i "1i\# Formula last updated on $(date +'%Y-%m-%d %H:%M:%S')" Formula/fpm.rb
72-
fi
7365
sed -i "s|url \".*\"|url \"https://github.com/fortran-lang/fpm/releases/download/${LATEST_VERSION_V}/fpm-${LATEST_VERSION}.zip\"|" Formula/fpm.rb
7466
sed -i "s|sha256 \".*\"|sha256 \"${SHA256}\"|" Formula/fpm.rb
67+
echo "# Formula last updated on $(date +'%Y-%m-%d %H:%M:%S')" >> Formula/fpm.rb
7568
7669
- name: Commit changes
7770
if: env.UPDATE_NEEDED == 'true'

0 commit comments

Comments
 (0)