#!/bin/bash

set -e

# <cylc-dir>/etc/dev-bin
THIS_DIR=$(cd $(dirname $0); pwd)
cd "${THIS_DIR}/../.."
if [[ -d .git || -f .git ]]; then
  echo "(a cylc VERSION file is not needed in a cylc git repo)" >&2
else    
  VN=${PWD#*cylc-}
  echo "Setting VERSION from parent directory name: $VN" >&2
  echo $VN > VERSION
fi
