This commit is contained in:
Daniel Flanagan 2023-04-16 02:30:45 -05:00
parent d3e101e624
commit 5cac960f32
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4

View file

@ -13,9 +13,20 @@ dfp="$(realpath "$(dirname "$0")"/../..)"
if [[ ! -d "$dfp/.git" ]]; then
echo "Not running from inside the dotfiles git repo, so we need to download it first!"
# each os needs instructions to install git, then we can clone the repo and proceed
if ! command -v git; then
if head /etc/os-release --lines 1 | grep 'Arch Linux' > /dev/null 2>&1; then
if [[ "$EUID" -ne 0 ]]; then
if ! command -v sudo; then
echo "Error: No sudo command available to try and install 'git'"
exit 1
else
sudo pacman -Sy --needed git
fi
else
pacman -Sy --needed git
fi
fi
fi
git clone https://git.lyte.dev/lytedev/dotfiles.git "$dfp"
fi