-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathrebuild.sh
executable file
·52 lines (38 loc) · 1.1 KB
/
rebuild.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
#!/usr/bin/env sh
cat <<- EOF
This script will:
- Kill any running build daemons
- Recursively remove any existing 'node_modules' folders
- Remove the '.build' directory
- Remove the 'amalthea' builds
- Rebuild the aforementioned 'node_modules' folders
This will probably take a while, so only run this script if you're stuck and
you need to restart from a fresh slate.
Once this script is done, launch the build tasks using:
- Cmd + Shift + B (macOS)
- Ctrl + Shift + B (Linux)
from within VSCode.
EOF
read -p 'Do you want to proceed? [y/N]: ' proceed
case "${proceed}" in
[yY]*) ;;
*)
echo "Operation aborted."
exit 0
;;
esac
# Kill any running deemons.
npm run kill-watchd
npm run kill-watch-webd
npm run kill-watch-clientd
npm run kill-watch-extensionsd
# Remove any existing node_modules folders.
git ls-files --directory -i -o -x node_modules | xargs rm -rf
# Remove the build directory.
rm -rf .build
# Remove the amalthea builds.
rm -rf extensions/positron-r/amalthea/target/debug
rm -rf extensions/positron-r/amalthea/target/release
# Run npm install to rebuild 'node_modules'.
npm install
echo "Done"