Sha256: 3f81824884546538927b7a60ec4920dff1ff2b573c913dde1f4e8e46375e340c

Contents?: true

Size: 1.53 KB

Versions: 4

Compression:

Stored size: 1.53 KB

Contents

#!/usr/bin/env bash
set -eo pipefail

# Use binstubs. Work from the root dir.
app_root="$( cd "$(dirname "$0")/.."; pwd )"

# Prefer bin/ executables
export PATH="$app_root/bin:$PATH"

if [ "$1" = "-v" ]; then
  exec 3>&1
else
  exec 3>/dev/null
  exec 4>&1
  trap 'echo "Setup failed - run \`bin/setup -v\` to see the error output" >&4' ERR
fi

brew_install_missing() {
  if which brew > /dev/null; then
    if ! which "$1" > /dev/null; then
      echo " -- Installing Homebrew package: $@"
      brew reinstall "$@"
    fi
  else
    return 1
  fi
}

abort() {
  echo "$@"
  return 2
}

echo "--- Installing Ruby gems"
{
  if which rbenv > /dev/null; then
    rbenv install --skip-existing
  else
    if ! which ruby > /dev/null; then
      brew_install_missing ruby || abort "Can't find or install Ruby. Install it from https://www.ruby-lang.org or with https://github.com/rbenv/rbenv"
    fi
  fi
  gem list -i bundler >/dev/null 2>&1 || gem install bundler
  bundle check || bundle install
} >&3 2>&1

echo "--- Installing npm modules"
{
  if ! which npm > /dev/null; then
    brew_install_missing "npm" || abort "Can't find or install npm. Install it from https://nodejs.org"
  fi
  npm install
} >&3 2>&1

if [ -d "$HOME/.pow" ]; then
  echo "--- Setting up Pow"
  { ln -nfs "$app_root" "$HOME/.pow/trix"
    touch tmp/restart.txt
  } >&3 2>&1
fi

echo
echo "Done!"
if [ -L "$HOME/.pow/trix" ]; then
  echo " * Open http://trix.dev to develop in-browser"
else
  echo " * Run \`bin/rackup\` to develop in-browser"
fi
echo " * Run \`bin/blade build\` to build Trix"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vapid-0.1.3 lib/vapid/vendor/trix/bin/setup
vapid-0.1.2 lib/vapid/vendor/trix/bin/setup
vapid-0.1.1 lib/vapid/vendor/trix/bin/setup
vapid-0.1.0 lib/vapid/vendor/trix/bin/setup