Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/dashboard/remove-sources.sh
2492 views
1
#!/bin/bash
2
3
# remove source maps
4
rm -rvf dist/*.map;
5
6
# ensure all files using Google Analytics have the proper format
7
# shellcheck disable=SC2044
8
for i in $(find public/ -name "*.html"); do
9
if grep -q "Global site tag" "$i"; then
10
if ! grep -q -- "-- gtag end --" "$i"; then
11
echo "$i does not have a gtag end marker. This would break the remove-sources.sh script."
12
echo 'Please add <!-- gtag end --> after the Google Analytics block'
13
exit 1
14
fi
15
fi
16
done
17
18
# remove Google Analytics
19
echo "BEWARE: This script actually modifies files in the source tree"
20
rm public/google2db8c31aefd7ebbd.html
21
# shellcheck disable=SC2044
22
for i in $(find public/ -name "*.html"); do
23
sed -i '/<!-- Global site tag/,/gtag end/d' "$i";
24
done
25
26