-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·71 lines (55 loc) · 1.81 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·71 lines (55 loc) · 1.81 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
#######################################################
# install.sh
# This script sets up a laptop the way that I like it.
#######################################################
set -e
DOTFILES="$HOME/.dotfiles"
puts() {
local fmt="$1"; shift
printf "\n$fmt\n" "$@"
}
if ! command -v brew >/dev/null; then
puts "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# A fresh Homebrew install isn't on PATH yet in this shell.
for brew_bin in /opt/homebrew/bin/brew /usr/local/bin/brew; do
if [ -x "$brew_bin" ]; then
eval "$("$brew_bin" shellenv)"
break
fi
done
if ! command -v git >/dev/null; then
brew install git
fi
if [ ! -d "$DOTFILES" ]; then
puts "Cloning dotfiles..."
git clone https://github.com/scrogson/dotfiles "$DOTFILES"
fi
puts "Updating Homebrew..."
brew update
brew bundle --file="$DOTFILES/Brewfile"
puts "Linking dotfiles..."
just --justfile "$DOTFILES/Justfile" --working-directory "$DOTFILES" link
puts "Installing Neovim plugins..."
nvim --headless "+Lazy! sync" +qa
puts "Installing theme watcher..."
just --justfile "$DOTFILES/Justfile" --working-directory "$DOTFILES" theme-watcher
if ! grep -Fxq "$(which fish)" /etc/shells; then
puts "Adding fish to list of shells"
echo "$(which fish)" | sudo tee -a /etc/shells
fi
case "$SHELL" in
*/fish) : ;;
*)
puts "Changing SHELL to fish..."
chsh -s "$(which fish)"
;;
esac
# Not run automatically — it rewrites system preferences, so it gets a look
# first. Generated by scripts/macos/capture.sh on the old Mac and committed.
if [ -x "$DOTFILES/scripts/macos/restore.sh" ]; then
puts "macOS settings are ready to apply. Review, then run:"
puts " less %s && %s" "$DOTFILES/scripts/macos/restore.sh" "$DOTFILES/scripts/macos/restore.sh"
fi