#!/bin/sh # script/bootstrap: Resolve all dependencies that the application requires to # run. set -e cd "$[dirname $0]/.." if test -f "Brewfile" && test $[uname -s] = "Darwin" { brew bundle check >/dev/null !2 > !1 || do { echo "==> Installing Homebrew dependencies…" brew bundle } } if test -f ".ruby-version" && test -z $[rbenv version-name !2 >/dev/null] { echo "==> Installing Ruby…" rbenv install --skip-existing which bundle >/dev/null !2 > !1 || do { gem install bundler rbenv rehash } } if test -f "Gemfile" { echo "==> Installing gem dependencies…" bundle check --path vendor/gems >/dev/null !2 > !1 || do { bundle install --path vendor/gems --quiet --without production } } (CommandList children: [ (C {(set)} {(-e)}) (C {(cd)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(dirname)} {(DQ ($ VSub_Number "$0"))})]) left_token: spids: [19 25] ) (/..) ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (C {(Lit_Other "[")} {(-f)} {(DQ (Brewfile))} {(Lit_Other "]")}) (C {(Lit_Other "[")} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(uname)} {(-s)})]) left_token: spids: [47 51] ) ) } {(Lit_Other "=")} {(DQ (Darwin))} {(Lit_Other "]")} ) ] op_id: Op_DAmp ) terminator: ) ] action: [ (AndOr children: [ (SimpleCommand words: [{(brew)} {(bundle)} {(check)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [72] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[75]) ] ) (BraceGroup children: [ (C {(echo)} {(DQ ("==> Installing Homebrew dependencies\u2026"))}) (C {(brew)} {(bundle)}) ] spids: [80] ) ] op_id: Op_DPipe ) ] spids: [-1 63] ) ] spids: [-1 97] ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (C {(Lit_Other "[")} {(-f)} {(DQ (.ruby-version))} {(Lit_Other "]")}) (C {(Lit_Other "[")} {(-z)} { (DQ (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(rbenv)} {(version-name)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [124] ) ] ) ] ) left_token: spids: [119 126] ) ) } {(Lit_Other "]")} ) ] op_id: Op_DAmp ) terminator: ) ] action: [ (C {(echo)} {(DQ ("==> Installing Ruby\u2026"))}) (C {(rbenv)} {(install)} {(--skip-existing)}) (AndOr children: [ (SimpleCommand words: [{(which)} {(bundle)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [153] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[156]) ] ) (BraceGroup children: [(C {(gem)} {(install)} {(bundler)}) (C {(rbenv)} {(rehash)})] spids: [161] ) ] op_id: Op_DPipe ) ] spids: [-1 132] ) ] spids: [-1 178] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(DQ (Gemfile))} {(Lit_Other "]")}) terminator: ) ] action: [ (C {(echo)} {(DQ ("==> Installing gem dependencies\u2026"))}) (AndOr children: [ (SimpleCommand words: [{(bundle)} {(check)} {(--path)} {(vendor/gems)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [212] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[215]) ] ) (BraceGroup children: [ (C {(bundle)} {(install)} {(--path)} {(vendor/gems)} {(--quiet)} {(--without)} {(production)} ) ] spids: [220] ) ] op_id: Op_DPipe ) ] spids: [-1 194] ) ] spids: [-1 240] ) ] )