From a67e85a0369baee9f795320c1515ebd7273d96eb Mon Sep 17 00:00:00 2001 From: Daniel Barber Date: Mon, 22 Apr 2019 22:25:50 -0400 Subject: [PATCH] Use process substitution to run the script This ensures that we can get input from the terminal. --- README.md | 2 +- extra.sh | 1 + lib/chunkwm.sh | 2 +- lib/dotfiles.sh | 1 + lib/macos.sh | 2 +- setup.sh | 3 ++- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f05acb8..aec8baa 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,5 @@ Script and Brewfile to setup a Mac for development. 1. Run the setup script with: ```sh - curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/setup.sh | sh` + $ sh <( curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/setup.sh ) ``` diff --git a/extra.sh b/extra.sh index ccf80f6..7c03cad 100755 --- a/extra.sh +++ b/extra.sh @@ -1,4 +1,5 @@ #!/bin/sh + MAC_SETUP_DIR="$HOME/mac-setup" BOLD="\033[1m" diff --git a/lib/chunkwm.sh b/lib/chunkwm.sh index 4a05668..045edaf 100755 --- a/lib/chunkwm.sh +++ b/lib/chunkwm.sh @@ -2,7 +2,7 @@ # Ask the user to generate a code signing key for `chunkwm` echo "Please generate a code signing certificate called 'chunkwm-cert' in Keychain Access" -sh -c 'read -r -p "Press any key to continue... " -n 1' +read -r -p "Press any key to continue... " -n 1 # We need to code sign chunkwm and skhd in order for them to be added to the # accessibility allowed list. diff --git a/lib/dotfiles.sh b/lib/dotfiles.sh index 2b45a3e..98fae75 100755 --- a/lib/dotfiles.sh +++ b/lib/dotfiles.sh @@ -1,4 +1,5 @@ #!/bin/sh + cd "$HOME" if [ $SHELL != $(which zsh) ]; then diff --git a/lib/macos.sh b/lib/macos.sh index 43c069b..0f75aee 100755 --- a/lib/macos.sh +++ b/lib/macos.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Close any open System Preferences panes, to prevent them from overriding # settings we’re about to change diff --git a/setup.sh b/setup.sh index f393d76..e0466f3 100755 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,5 @@ #!/bin/sh + MAC_SETUP_DIR="$HOME/mac-setup" BOLD="\033[1m" @@ -19,7 +20,7 @@ if [ ! -f "$HOME/.ssh/id_ed25519.pub" ]; then echo "============ Public key =============" cat ~/.ssh/id_ed25519.pub echo "=====================================" - sh -c 'read -r -p "Press any key to continue... " -n 1' + read -r -p "Press any key to continue... " -n 1 fi # Add the SSH key to the agent now to avoid multiple prompts