Add platform check for sed command

This checks if the current platform is macOS (darwin), which uses a sed version that accepts arguments differently
This commit is contained in:
Jelle Besseling 2019-01-15 11:19:30 +01:00 committed by GitHub
parent 986f3df957
commit c2eea80929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

6
burrow
View File

@ -166,7 +166,11 @@ update_gopher_root () {
"$newdate" \
"$config_gopher_server" \
"$config_gopher_port")
sed -i '' "s|.*Last\\ Updated:.*|${newString}|" "${config_dir_gopher}gophermap"
if [ "$(uname)" = "Darwin" ]; then
sed -i '' "s|.*Last\\ Updated:.*|${newString}|" "${config_dir_gopher}gophermap"
else
sed -i'' "s|.*Last\\ Updated:.*|${newString}|" "${config_dir_gopher}gophermap"
fi
}
check_directory () {