Path: blob/main/components/dashboard/remove-sources.sh
2492 views
#!/bin/bash12# remove source maps3rm -rvf dist/*.map;45# ensure all files using Google Analytics have the proper format6# shellcheck disable=SC20447for i in $(find public/ -name "*.html"); do8if grep -q "Global site tag" "$i"; then9if ! grep -q -- "-- gtag end --" "$i"; then10echo "$i does not have a gtag end marker. This would break the remove-sources.sh script."11echo 'Please add <!-- gtag end --> after the Google Analytics block'12exit 113fi14fi15done1617# remove Google Analytics18echo "BEWARE: This script actually modifies files in the source tree"19rm public/google2db8c31aefd7ebbd.html20# shellcheck disable=SC204421for i in $(find public/ -name "*.html"); do22sed -i '/<!-- Global site tag/,/gtag end/d' "$i";23done242526