-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup_cursor
executable file
·38 lines (29 loc) · 1.19 KB
/
setup_cursor
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
#!/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
if [ "$(uname -s)" != 'Darwin' ]; then
echo "Error: This script ought to be run on macOS only."
exit 1
fi
this_path=$(cd "$(dirname "$0")" && pwd)
### Symlink configuration ######################################################
user_path="$HOME/Library/Application Support/Cursor/User"
backup_path="$this_path/.backup/Library/Application Support/Cursor/User"
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 cursor >/dev/null; then
while read -r extension; do
cursor --force --install-extension "$extension"
done <"$this_path/vscode/extensions.list"
fi