forked from wfpaisa/plane-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·32 lines (28 loc) · 885 Bytes
/
bootstrap.sh
File metadata and controls
executable file
·32 lines (28 loc) · 885 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
#!/usr/bin/env bash
repo_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )"
attach() {
plane_path="$( find ~/.vscode/extensions -maxdepth 1 -type d -name 'plane*' )"
if [[ "$plane_path" ]]; then
plane_dir="$( basename "$plane_path" )"
mkdir -p ~/.vscode/extensions/disabled
mv "$plane_path" ~/.vscode/extensions/disabled/"$plane_dir"
fi
ln -s "$repo_dir" ~/.vscode/extensions/plane
}
eject() {
rm -f ~/.vscode/extensions/plane
if [ -d ~/.vscode/extensions/disabled ]; then
disabled_path="$( find ~/.vscode/extensions/disabled -maxdepth 1 -type d -name 'plane*' )"
plane_dir="$( basename "$disabled_path" )"
mv "$disabled_path" ~/.vscode/extensions/"$plane_dir"
rm -r ~/.vscode/extensions/disabled
fi
}
case "$1" in
attach)
attach
;;
eject)
eject
;;
esac