-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·48 lines (34 loc) · 1.13 KB
/
install.sh
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
#! /usr/bin/env bash
set -euo pipefail
if [ -e ~/.zshrc ]; then
echo "You have an existing ~/.zshrc file, please remove it and rerun install.sh to create one that'll load from $ZSHDIR"
exit 1
else
SCRIPTDIR=$(cd "$(dirname "$0")" && pwd)
export ZSHDIR=$SCRIPTDIR
mkdir -p "$ZSHDIR/nonshared-zshrc"
touch "$ZSHDIR/nonshared-zshrc/zshrc"
INSTALL_TO=~/.zshrc
cat <<EOF > $INSTALL_TO
export ZSHDIR=$SCRIPTDIR
export HOSTNAME=\$(hostname)
source \$ZSHDIR/zshrc_base
source \$ZSHDIR/zshrc_options
# echo "sourcing general nonshared-zshrc/zshrc"
source \$ZSHDIR/nonshared-zshrc/zshrc
HOST_SPECIFIC_FILE=\$ZSHDIR/nonshared-zshrc/$HOSTNAME
if [ -e \$HOST_SPECIFIC_FILE ]
then
echo "Loading zshrc for host $HOSTNAME"
source \$ZSHDIR/nonshared-zshrc/$HOSTNAME
else
echo "creating file for host-specific overrides $HOSTNAME"
touch \$ZSHDIR/nonshared-zshrc/$HOSTNAME
fi
EOF
echo "Done creating ~/.zshrc file that expects zsh script in $SCRIPTDIR"
echo ""
echo "You likely want to run these now and then restart your shell:"
echo "brew install fzf ripgrep bat fd findutils"
echo "brew install getantibody/tap/antibody"
fi