Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8 from richo/features/sane_shell_tests

Use FOO_VERSION variables to detect shells
  • Loading branch information...
commit a37a6769f64300f48dc6154f86693a6916bbd596 2 parents 1613c92 + cb9bf0f
@benhoskings authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 app/views/bootstrap/up.sh.erb
View
7 app/views/bootstrap/up.sh.erb
@@ -9,9 +9,6 @@ ref=<%= ref %>
# So: write a string in which ~$(whoami) is expanded, and run it in a subshell.
home=$(sh -c "echo ~$(whoami)")
-# The name of the shell we're running on.
-shell=$(ps -c -o command -p $$ | tail -n1 | sed -e 's/^\-//')
-
from="https://github.com/benhoskings/babushka/archive/$ref.tar.gz"
to="$home/.babushka/bootstrap"
@@ -114,9 +111,9 @@ welcome() {
else
echo ""
confirmed=""
- if [ "$shell" = "zsh" ]; then
+ if [ -n "$ZSH_VERSION" ]; then
vared -p "Sound good? [y/N] " confirmed
- elif [ "$shell" = "bash" ]; then
+ elif [ -n "$BASH_VERSION" ]; then
read -e -p "Sound good? [y/N] " confirmed
else
read -p "Sound good? [y/N] " confirmed
Please sign in to comment.
Something went wrong with that request. Please try again.