forked from posit-dev/positron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rebuild.sh
executable file
·55 lines (40 loc) · 1.24 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
53
54
55
#!/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.
yarn run kill-watchd
yarn run kill-watch-webd
yarn run kill-watch-clientd
yarn run kill-watch-extensionsd
# Disabled for now because it hangs. This needs to be investigated, but it's not worth doing right at the moment.
#yarn run kill-watch-build-toolsd
# 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 yarn to rebuild 'node_modules'.
yarn
echo "Done"