-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup_vscodium
executable file
·52 lines (41 loc) · 1.69 KB
/
setup_vscodium
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
#!/bin/sh
# configent (https://github.com/raas-dev/configent)
# One command automated macOS/Linux laptop/VM/container bootstrapper.
#
# Copyright(C) 2016- Anssi Syrjäsalo (http://a.syrjasalo.com)
# Licensed under GNU Lesser General Public License v3 (LGPL-3.0).
trap "printf '\nCaught ^C from user - exiting now\n' ; exit 130" INT
this_path=$(cd "$(dirname "$0")" && pwd)
### Symlink configuration ######################################################
if [ "$(uname -s)" = "Darwin" ]; then
user_path="$HOME/Library/Application Support/VSCodium/User"
backup_path="$this_path/.backup/Library/Application Support/VSCodium/User"
else
user_path="$HOME/.config/VSCodium/User"
backup_path="$this_path/.backup/.config/VSCodium/User"
fi
if [ ! -d "$backup_path" ] && [ -d "$user_path" ]; then
mkdir -p "$backup_path"
rm -rf "$backup_path"
cp -RP "$user_path" "$backup_path"
fi
mkdir -p "$user_path" # ensure intermediate directories exist
rm -rf "$user_path"
ln -sfnv "$this_path/vscode" "$user_path"
### Install extensions #########################################################
if command -v codium >/dev/null; then
while read -r extension; do
codium --force --install-extension "$extension"
done <"$this_path/vscode/extensions.list"
fi
### Symlink continue config ####################################################
backup_path="$this_path/.backup"
config_path="$HOME/.config/configent"
if [ ! -r "$backup_path/.continue/config.ts" ]; then
if [ -r "$HOME/.continue/config.ts" ]; then
mkdir -p "$backup_path/.continue"
cp -P "$HOME/.continue/config.ts" "$backup_path/.continue/config.ts"
fi
fi
mkdir -p "$HOME/.continue"
ln -sfnv "$config_path/continue/config.ts" "$HOME/.continue/config.ts"