summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rwxr-xr-xinstall/vscode.fish38
1 files changed, 38 insertions, 0 deletions
diff --git a/install/vscode.fish b/install/vscode.fish
new file mode 100755
index 0000000..70a2fc7
--- /dev/null
+++ b/install/vscode.fish
@@ -0,0 +1,38 @@
+#!/bin/fish
+
+. (dirname (status filename))/util.fish
+
+function confirm-copy -a from to
+ if test -e $to
+ read -l -p "input '$(realpath $to) already exists. Overwrite? [y/N] ' -n" confirm
+ test "$confirm" = 'y' -o "$confirm" = 'Y' && log 'Continuing.' || return
+ end
+ cp $from $to
+end
+
+install-deps git
+
+set -l dist $CONFIG/vscode
+
+# Clone repo
+confirm-overwrite $dist
+git clone 'https://github.com/caelestia-dots/vscode.git' $dist
+
+# Install settings
+for prog in 'Code' 'Code - OSS' 'VSCodium'
+ set -l $conf $CONFIG/../$prog
+ if test -d $conf
+ confirm-copy $dist/settings.json $conf/User/settings.json
+ confirm-copy $dist/keybindings.json $conf/User/keybindings.json
+ end
+end
+
+# Install extension
+for prog in code code-insiders codium
+ if which $prog &> /dev/null
+ log "Installing extension for '$prog'"
+ $prog --install-extension $dist/caelestia-vscode-integration/caelestia-vscode-integration-0.0.1.vsix
+ end
+end
+
+log 'Done.'