Skip to content

Commit

Permalink
Hopefully fix script on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Nov 26, 2023
1 parent 474ee61 commit f6b1bb7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions config/build-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" {} +
}

0 comments on commit f6b1bb7

Please sign in to comment.