From 26546f827d74d879cc46239fbb286b88b909958e Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Fri, 30 Dec 2022 11:59:54 +0000 Subject: [PATCH] Separate the sed usage in installer script based on the os type --- scripts/install_files.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/install_files.sh b/scripts/install_files.sh index 30cf3f0..8693e96 100644 --- a/scripts/install_files.sh +++ b/scripts/install_files.sh @@ -56,8 +56,16 @@ install_runners() { info "Creating the runner scripts..." cp "$current/templates/fg42" "$current/../fg42" cp "$current/templates/fg42-wm" "$current/../fg42-wm" - sed -i'' "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42" - sed -i'' "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42-wm" + + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + sed -i "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42" + sed -i "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42-wm" + fi + + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i'' -e "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42" + sed -i'' -e "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42-wm" + fi chmod +x "$fg42_home/fg42" chmod +x" $fg42_home/fg42-wm"