-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathautoclean.sh
More file actions
40 lines (35 loc) · 848 Bytes
/
autoclean.sh
File metadata and controls
40 lines (35 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/false
# WARNING! WARNING! WARNING!
#
# This script will delete your custom cads and cases.
# Run it explicitly with
#
# $ sh autoclean.sh
#
# It does not have execution permissions to avoid running it by mistake.
#
# WARNING! WARNING! WARNING!
if [ ! -d auths ]; then
echo "error: run $0 from SunCAE's root directory"
echo 1
fi
# cat .gitgnore?
for i in bin deps data node_modules test-results playwright-report; do
echo -n "cleaning ${i}... "
rm -rf ${i} || exit 1
echo "ok"
done
pwd=$PWD
for i in $(find . -name .gitignore); do
dir=$(dirname ${i})
if [ "x${dir}" != "x." ]; then
echo "cleaning ${dir}"
cd ${dir}
cat .gitignore | sed '/^#.*/ d' | sed '/^\s*$/ d' | sed 's/^/rm -rf /' | bash || exit 1
cd ${pwd}
fi
done
# more
for i in x3dom.js x3dom.css; do
find . -name {$i} | xargs rm -f
done