Merge pull request #10575 from savonarola/0502-fix-dev-script-macos

chore(dev): fix dev script on macos
This commit is contained in:
Ilya Averyanov 2023-05-02 19:49:48 +03:00 committed by GitHub
commit 8e7ba2b6d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

6
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"
if [[ "$UNAME" == "Darwin" ]]; then
sed -i '' "s|{{[[:space:]]*${name}[[:space:]]*}}|${value}|g" "$file"
else
sed -i "s|{{\s*${name}\s*}}|${value}|g" "$file" sed -i "s|{{\s*${name}\s*}}|${value}|g" "$file"
fi
} }
## render the merged boot conf file. ## render the merged boot conf file.