forked from mantrajs/meteor-mantra-kickstarter
-
Notifications
You must be signed in to change notification settings - Fork 4
/
clean_all.sh
executable file
·59 lines (50 loc) · 1.51 KB
/
clean_all.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
#
declare PKGS_DIR=".pkgs";
function CleanLocalNodePackages() {
local PKGS_DIR=${1};
local SHALLOW=${2};
echo "Cleaning local node packages . . . ";
pushd ${PKGS_DIR} >/dev/null;
echo -e "In dir $(pwd)";
for item in *
do
if [[ -d ${item} ]]; then
rm -fr ${item}/node_modules 2>/dev/null;
rm -fr ${item}/dist 2>/dev/null;
fi;
done;
[ -z ${SHALLOW} ] && rm -fr gitignored_*;
popd >/dev/null;
[ -f ~/.userVars.sh ] && sed -i '/NON_STOP/s/.*/export NON_STOP=no;/' ~/.userVars.sh;
echo "Cleaned local node packages .";
}
function CleanAllInstalledPackages() {
local SHALLOW=${1};
echo "Cleaning build artifacts. SHALLOW = ${SHALLOW}";
rm -fr node_modules;
rm -fr .meteor/local/;
rm -fr .habitat/results;
rm -fr public/mobile/android/*.apk*;
rm -fr npm-debug.log;
rm -fr ${HOME}/.npm-global/lib/node_modules
rm -fr .e2e_tests/features/5*;
.scripts/dropLocalPackages.sh;
CleanLocalNodePackages ${PKGS_DIR} ${1};
if [[ -d ../${PKGS_DIR} ]]; then
CleanLocalNodePackages ../${PKGS_DIR} ${1};
fi;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~??????~~~>> rm -fr ~/.meteor;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo "... cleaned build artifacts.";
}
function RemoveImportedPackages() {
echo "Removing Imported Packages . . . ";
rm -fr .e2e_tests/features/5*;
rm -fr .pkgs/gitignored*;
echo "... Imported Packages Removed.";
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
declare SHALLOW=${1};
CleanAllInstalledPackages ${SHALLOW};
fi;