Sha256: 5f333ebd13506f77477414e436daab7b4a123201cf5cb0f4343f0f4b9d6b7c78

Contents?: true

Size: 564 Bytes

Versions: 56

Compression:

Stored size: 564 Bytes

Contents

#!/usr/bin/env bash

function main {
  set -e

  add_new_env_vars
  bundle install
  bundle exec rake db:setup
}

function add_new_env_vars {
  # create .env and set perms if it does not exist
  [ ! -f .env ] && { touch .env ; chmod 0600 .env ; }

  export IFS=$'\n'
  for var in `cat .env.sample`; do
    key="${var%%=*}"     # get var key
    var=`eval echo $var` # generate dynamic values

    # If .env doesn't contain this env key, add it
    if ! `grep -qLE "^$key=" .env`; then
      echo "Adding $key to .env"
      echo $var >> .env
    fi
  done
}

main

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
pliny-0.20.1 lib/template/bin/setup
pliny-0.20.0 lib/template/bin/setup
pliny-0.19.0 lib/template/bin/setup
pliny-0.18.0 lib/template/bin/setup
pliny-0.17.1 lib/template/bin/setup
pliny-0.17.0 lib/template/bin/setup
pliny-0.16.3 lib/template/bin/setup
pliny-0.16.2 lib/template/bin/setup
pliny-0.16.1 lib/template/bin/setup
pliny-0.16.0 lib/template/bin/setup
pliny-0.15.1 lib/template/bin/setup
pliny-0.15.0 lib/template/bin/setup
pliny-0.14.2 lib/template/bin/setup
pliny-0.14.1 lib/template/bin/setup
pliny-0.14.0 lib/template/bin/setup
pliny-0.13.1 lib/template/bin/setup
pliny-0.13.0 lib/template/bin/setup
pliny-0.12.0 lib/template/bin/setup
pliny-0.11.2 lib/template/bin/setup
pliny-0.11.1 lib/template/bin/setup