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-1.1.0 lib/template/bin/setup
pliny-1.0.0 lib/template/bin/setup
pliny-0.32.0 lib/template/bin/setup
pliny-0.31.0 lib/template/bin/setup
pliny-0.30.1 lib/template/bin/setup
pliny-0.30.0 lib/template/bin/setup
pliny-0.29.0 lib/template/bin/setup
pliny-0.28.0 lib/template/bin/setup
pliny-0.27.1 lib/template/bin/setup
pliny-0.27.0 lib/template/bin/setup
pliny-0.26.2 lib/template/bin/setup
pliny-0.26.1 lib/template/bin/setup
pliny-0.26.0 lib/template/bin/setup
pliny-0.25.1 lib/template/bin/setup
pliny-0.25.0 lib/template/bin/setup
pliny-0.24.0 lib/template/bin/setup
pliny-0.23.0 lib/template/bin/setup
pliny-0.22.0 lib/template/bin/setup
pliny-0.21.0 lib/template/bin/setup
pliny-0.20.2 lib/template/bin/setup