-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbefore-setup.sh
executable file
·33 lines (25 loc) · 1.03 KB
/
before-setup.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
#!/bin/bash
# Enable debug output
PS4="\n\033[1;33m>>\033[0m "; set -x
LOCATION=$(realpath "$0")
DIR=$(dirname "$LOCATION")
# Cache sudo credential
sudo -v
datetime=$(date +'%Y-%m-%d_%H:%M:%S')
# Original code from https://github.com/driesvints/dotfiles/blob/main/fresh.sh
# Check for Homebrew and install if we don't have it
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [ "$(uname)" == "Linux" ]; then
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/dps0340/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/dps0340/.zshrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
else
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
if test ! $(which nix-env); then
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
fi
echo "Please restart the terminal emulator!!!"