diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 7b26be0..5c679ee 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -5,7 +5,11 @@ jobs: build: runs-on: macos-10.15 steps: - - uses: action/checkout@v2 - - name: one line script - run: echo 'Hello, world!' + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install shellcheck shfmt + - name: shellcheck + run: shellcheck bootstrap + - name: shfmt + run: shfmt -s -i 2 -bn -ci -sr -kp bootstrap diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 265c12b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: bash -os: osx -before_script: -- brew update -- brew install shellcheck -- brew install shunit2 -script: -- shellcheck bootstrap -- shellcheck macos-defaults -#- echo "Europe/Paris ${TRAVIS_OS_NAME} macos-defaults y n" | sh bootstrap -#- echo "Europe/Paris ${TRAVIS_OS_NAME} macos-defaults y y" | sh bootstrap diff --git a/README.md b/README.md index f42a417..43284d6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mac Bootstrap [![Build Status](https://travis-ci.org/deild/mac-bootstrap.svg?branch=master)](https://travis-ci.org/deild/mac-bootstrap) [![MIT](https://img.shields.io/badge/license-MIT-BLUE)](LICENSE) +# Mac Bootstrap ![shellcheck](https://github.com/deild/mac-bootstrap/workflows/shellcheck/badge.svg) [![MIT](https://img.shields.io/badge/license-MIT-BLUE)](LICENSE) > Your laptop is your sword. Don't go into battle without it. diff --git a/bootstrap b/bootstrap index d5da2dd..be72711 100644 --- a/bootstrap +++ b/bootstrap @@ -79,26 +79,26 @@ printf "Let's get some infos about your setup.\\n" printf "\\nEnter your desired time zone. To view available options run 'sudo systemsetup -listtimezones' in other terminal -(Leave blank for default: %s)\\n>_ " "$DEFAULT_TIME_ZONE" -read TIME_ZONE + Leave blank for default: %s)\\n>_ " "$DEFAULT_TIME_ZONE" +read -r TIME_ZONE export TIME_ZONE=${TIME_ZONE:-$DEFAULT_TIME_ZONE} printf '\nEnter your desired computer name for your Mac. (Leave blank for default: %s)\n>_ ' "$ACTUAL_COMPUTER_NAME" -read COMPUTER_NAME +read -r COMPUTER_NAME export COMPUTER_NAME="${COMPUTER_NAME:-$ACTUAL_COMPUTER_NAME}" printf '\nEnter url for masOS defaults file. (Leave blank for default: %s)\n>_ ' "$MACOS_DEFAULT_URL" -read MACOS_URL +read -r MACOS_URL export MACOS_URL="${MACOS_URL:-$MACOS_DEFAULT_URL}" printf 'Do you want disable Gatekeeper? (Y/n) \n>_ ' -read REPLY +read -r REPLY if [[ $REPLY =~ ^[Nn]$ ]]; then GATEKEEPER_DISABLE="No" fi printf '\nEnter a passphrase for generete ssh key. (Leave blank for default: %s)\n>_ ' "$DEFAULT_PASSPHRASE" -read PASSPHRASE +read -r PASSPHRASE export PASSPHRASE="${PASSPHRASE:-$DEFAULT_PASSPHRASE}" printf "\\nLooks good. Here's what we've got so far.\\n" @@ -109,7 +109,7 @@ bootstrap_echo "macos defaults file: [%s]" "$MACOS_URL" bootstrap_echo "Passphrase [%s]" "$PASSPHRASE" printf '\n' printf "Continue? (y/N) \\n>_ " -read REPLY +read -r REPLY if [[ ! $REPLY =~ ^[Yy]$ ]]; then bootstrap_echo "Exit on demand" exit 0 @@ -314,7 +314,7 @@ brew cleanup -s --prune 1 if ! command -v virtualbox; then if ! brew cask install virtualbox; then printf "Continue? (y/N) \\n>_ " - read REPLY + read -r REPLY if [[ ! $REPLY =~ ^[Yy]$ ]]; then bootstrap_echo "Exit on demand" exit 0