Ports: Use sed -i for run_replace_in_file on Serenity hosts

We don't have a perl port, so let's use GNU sed's in-place option for
doing substitutions when running inside Serenity.

Note that we can't do this unconditionally, as `sed -i` is not portable
and works differently on BSD systems.
This commit is contained in:
Daniel Bertalan 2022-02-23 15:00:08 +01:00 committed by Linus Groh
parent ea52ba9fdc
commit aed2e214b6

View file

@ -108,7 +108,11 @@ run() {
}
run_replace_in_file() {
run perl -p -i -e "$1" $2
if [ "$(uname -s)" = "SerenityOS" ]; then
run sed -i "$1" $2
else
run perl -p -i -e "$1" $2
fi
}
get_new_config_sub() {