Fixed sed command in postinstall script to be platform dependent

This commit is contained in:
n1474335 2021-01-22 14:47:33 +00:00
parent e53108c493
commit 345ad741b3
2 changed files with 7 additions and 1 deletions

6
postinstall.sh Executable file
View file

@ -0,0 +1,6 @@
# Add file extensions to Crypto-Api imports
if [[ "$OSTYPE" == "darwin"* ]]; then
find ./node_modules/crypto-api/src/ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i '' -e '/\.mjs/!s/\(from "\.[^"]*\)";/\1.mjs";/g'
else
find ./node_modules/crypto-api/src/ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i -e '/\.mjs/!s/\(from "\.[^"]*\)";/\1.mjs";/g'
fi