From f6b1bb77f00a78dedd4aafef940de2ce038e4865 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 26 Nov 2023 10:05:36 -0800 Subject: [PATCH] Hopefully fix script on ci --- config/build-util.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/build-util.sh b/config/build-util.sh index d13d9b533..b48fcb202 100755 --- a/config/build-util.sh +++ b/config/build-util.sh @@ -34,7 +34,15 @@ ensure_bash_4() { remove_all_css_imports() { local directory=$1 + local sed_cmd="sed -i" - find "$directory" -type f -name "*.js" -exec sed -i '' "/require('.\/.*\.css');/d" {} + - find "$directory" -type f -name "*.js" -exec sed -i '' "/import \".\/.*\.css\";/d" {} + + # Check if sed is GNU sed or BSD sed + if sed --version 2>/dev/null | grep -q GNU; then + sed_cmd="sed -i" # GNU sed + else + sed_cmd="sed -i ''" # BSD sed + fi + + find "$directory" -type f -name "*.js" -exec $sed_cmd "/require('.\/.*\.css');/d" {} + + find "$directory" -type f -name "*.js" -exec $sed_cmd "/import \".\/.*\.css\";/d" {} + } \ No newline at end of file