#! /bin/sh

if (( $# != 1 )); then
  echo "Call this script with the name of the environment"
  echo "Example: ${0} production"
  exit 1
fi

ENVROOT='/etc/puppetlabs/code/environments'
GITDIR="${ENVROOT}/${1}/.git"

# check to make sure the env repo exists
if [ -d ${GITDIR} ];
then
  git --git-dir ${GITDIR} rev-parse --short HEAD
else
  date '+%s'
fi


#! /bin/sh

if (( $# != 1 )); then
  echo "Call this script with the name of the environment"
  echo "Example: ${0} production"
  exit 1
fi

ENVROOT='/etc/puppetlabs/code/environments'
GITDIR="${ENVROOT}/${1}/.git"

# check to make sure the env repo exists
if [ -e ${GITDIR} ];
then
  git --git-dir ${GITDIR} rev-parse --short HEAD
else
  date '+%s'
fi


Check for existence, not just directory
Check for existence, not just directory

This is a file when filesync is in use.

TRAINTECH-1062 #resolved #time 15m