File tree 2 files changed +9
-11
lines changed 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 42
42
Last time this was edited was.
43
43
</ p >
44
44
</ body >
45
- </ html >
45
+ </ html >
Original file line number Diff line number Diff line change 4
4
current_date=$( date +" %Y-%m-%d" )
5
5
6
6
# Update the date in the index.html file
7
- if [[ " $OSTYPE " == " darwin" * ]]; then
8
- # macOS version
9
- sed -i ' ' ' /<p>.*Last time this was edited was.*<\/p>/c\
10
- <p>\
11
- Last time this was edited was ' " $current_date " ' .\
12
- </p>' index.html
13
- else
14
- # Linux version
15
- sed -i ' /<p>.*Last time this was edited was.*<\/p>/c\ <p>\n Last time this was edited was ' " $current_date " ' .\n </p>' index.html
16
- fi
7
+ awk -v date=" $current_date " '
8
+ /<p>.*Last time this was edited was.*<\/p>/ {
9
+ print " <p>"
10
+ print " Last time this was edited was " date "."
11
+ print " </p>"
12
+ next
13
+ }
14
+ {print}' index.html > temp.html && mv temp.html index.html
17
15
18
16
# Add all changes to git
19
17
git add .
You can’t perform that action at this time.
0 commit comments