#!/usr/bin/env bash

# TODO: Read project and project_path from defaults file first.
if user_is_not_root
then
  true "${project:="$USER"}" "${project_path:="$HOME"}"
else
  # TODO: When run as root, we must ensure that project and project_path are set.
  true
fi

if variables_are_nonempty project project_path
then
  project_initialize
fi

export project environment project_path shared previous_path release_path \
  stage_path log_path

if module_is_loaded rvm
then
  if variable_is_nonempty release_path &&
    file_is_nonempty "${release_path}/.rvmrc"
  then
    source "${release_path}/.rvmrc"
  fi
fi

