niccokunzmann / 12characters-translations

Translations of the play 12 Characters

Home Page:https://12characters.org.uk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build.sh: sed -i command not working on macos

jasonestewart opened this issue · comments

on macos sed -i needs a backup prefix - once I changed the command to sed -i.bu things worked properly

I guess, you ran the build.sh file.

What is the error you see?
What does .bu do?
Would you like to create a pull request so I can try it out?

Hey Nicco,

Yes, sorry, I ran the build.sh and it failed.

The -i flag to sed can be given a parameter which is used to create a backup file of the original files before they are modified in-place - on platforms that use GNU sed that parameter is optional, macos doesn't use GNU sed, so the parameter is required. So -i.bu tells sed to make a backup of each file with the extension '.bu' appended to the original file.

Sadly, my solution doesn't actually work properly. The script runs and the book is made but now each character is duplicated - once for the .txt file and once for the .txt.bu file!! I believe the solution is to use the command sed -i '' on macos which means that it won't create a backup file. I will test it and post here again

I tried the sed -i '' and it worked properly on macos - I don't have access to my linux machine any more so I can't test it there. If you could test it and make sure that it doesn't break anything then that would be a fix that is cross-platform.

#21 fixes this, so I close this. If there are issues again, we can re-open.