chore(dev): fix dev script on macos

This commit is contained in:
Ilya Averyanov 2023-05-02 19:43:41 +03:00
parent 6a043ff09a
commit b357e6f9ff
1 changed files with 7 additions and 1 deletions

8
dev
View File

@ -2,6 +2,8 @@
set -euo pipefail set -euo pipefail
UNAME="$(uname -s)"
PROJ_ROOT="$(git rev-parse --show-toplevel)" PROJ_ROOT="$(git rev-parse --show-toplevel)"
cd "$PROJ_ROOT" cd "$PROJ_ROOT"
@ -138,7 +140,11 @@ mustache() {
local name="$1" local name="$1"
local value="$2" local value="$2"
local file="$3" local file="$3"
sed -i "s|{{\s*${name}\s*}}|${value}|g" "$file" if [[ "$UNAME" == "Darwin" ]]; then
sed -i '' "s|{{[[:space:]]*${name}[[:space:]]*}}|${value}|g" "$file"
else
sed -i "s|{{\s*${name}\s*}}|${value}|g" "$file"
fi
} }
## render the merged boot conf file. ## render the merged boot conf file.