Closed paladhammika closed 1 year ago
If you try to put @echo [${PWD}]
after cd ...
, bhante, you may note that cd
takes not effect. It seems like shell specific in Make. You are able to use the following construction:
@sed -i 's/\(This version was created on:\) *[0-9-]\{10\}/\1 '"$TODAY"'/' manuscript/html/OEBPS/Text/copyright.xhtml
Or even this one:
@cd manuscript/html/OEBPS/Text && sed -i 's/\(This version was created on:\) *[0-9-]\{10\}/\1 '"$TODAY"'/' copyright.xhtml
There is also no need to do cd ../../../
because it will not take effect too.
Also there will be a problem with the $TODAY
variable. You may set and use it e.g. in a such way:
TODAY=$(shell date --iso-8601)
...
epub: $(EPUBFILE)
$(EPUBFILE): $(SOURCEFILES)
...
@sed -i 's/\(This version was created on:\) *[0-9-]\{10\}/\1 '"$(TODAY)"'/' manuscript/html/OEBPS/Text/copyright.xhtml
...
(...
is for some other relative code).
❤️🙏🙏🙏
Sādhu! This was helpful.
I had to use sed within an enclosed shell command otherwise it would fail to produce the EPUB.
@$(shell command sed -i 's/\(This version was created on:\) *[0-9-]\{10\}/\1 '"$(TODAY)"'/' manuscript/html/OEBPS/Text/copyright.xhtml)
@bergentroll
The above is some
sed
magic which was used in earlier versions of this project. It automatically changed the time stamp (seen in the picture below) with each build.Attempts to implement this into the current Makefile have not been successful. Would you have any suggestions?