1
mirror of https://github.com/jakejarvis/dotfiles.git synced 2025-04-25 15:35:21 -04:00

make the install script directly pipeable (don't do this)

This commit is contained in:
Jake Jarvis 2021-03-16 13:08:30 -04:00
parent 10160f63c0
commit f1e8bddb4a
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
4 changed files with 27 additions and 8 deletions

View File

@ -17,8 +17,15 @@ Thanks for visiting, the `exit` is that way!
Designed for macOS, kinda works on Linux (requires [ZSH to be installed](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH#ubuntu-debian--derivatives-windows-10-wsl--native-linux-kernel-with-windows-10-build-1903) first):
```bash
git clone https://github.com/jakejarvis/dotfiles.git ~/.dotfiles
~/.dotfiles/install.sh
git clone --recurse-submodules https://github.com/jakejarvis/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
bash install.sh
```
or:
```bash
curl -sL jrvs.io/bootstrap | bash # probably don't do this if you're not me
```
## License

View File

@ -1,16 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
# what a mess. https://stackoverflow.com/a/53183593
YOU_ARE_HERE="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
echo "👋 Deep breaths, everything will (probably) be fine!"
# Ask for the administrator password upfront
sudo -v
# Clone this repo if we haven't already
git clone --recurse-submodules https://github.com/jakejarvis/dotfiles.git "$YOU_ARE_HERE" || true
# Set up symbolic links for ZSH and Git pointing to this cloned repo
ln -sf ~/.dotfiles/zsh/.zshrc ~/.zshrc
ln -sf ~/.dotfiles/git/.gitconfig ~/.gitconfig
ln -sf ~/.dotfiles/git/.gitignore_global ~/.gitignore_global
ln -sf "$YOU_ARE_HERE/zsh/.zshrc" ~/.zshrc
ln -sf "$YOU_ARE_HERE/git/.gitconfig" ~/.gitconfig
ln -sf "$YOU_ARE_HERE/git/.gitignore_global" ~/.gitignore_global
mkdir -p ~/.ssh
ln -sf ~/.dotfiles/ssh/.ssh/config ~/.ssh/config
ln -sf "$YOU_ARE_HERE/ssh/.ssh/config" ~/.ssh/config
# Suppress terminal login banners
touch ~/.hushlogin
@ -28,8 +36,8 @@ fi
git submodule update --init --recursive
if [ "$(uname)" == "Darwin" ]; then
# shellcheck disable=SC1091
source ./macos/macos.sh
# shellcheck disable=SC1090,SC1091
source "$YOU_ARE_HERE/macos/macos.sh"
else
echo ""
echo "This isn't a Mac, so we're all done here!"

View File

@ -6,6 +6,8 @@
# https://github.com/paulirish/dotfiles/blob/master/.osx
# https://github.com/kevinSuttle/macOS-Defaults/blob/master/.macos
set -euo pipefail
# Change new hostname here if necessary
COMPUTER_NAME="JJ-MBA"

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
# This shouldn't be run if not on macOS, but make double sure
if test ! "$(uname)" = "Darwin"; then
exit 0