#!/bin/sh
set -e
set -x

git submodule update -f --init --recursive

cd cloned
git clone -n https://github.com/cuelang/cue
cd cue
git checkout 317163484ec5d79259a4ea6524d3870419510639
cd ../..

PUSHD=$(pwd)
cat <<EOF > content/en/docs/references/spec.md
+++
title = "Language Specification"
+++
EOF
cat cloned/cue/doc/ref/spec.md >> content/en/docs/references/spec.md
cd content/en/docs/tutorials/tour
go test .
go run gen.go
cd ${PUSHD}

# TODO
#   shell documentation
#   cue/doc/contribute.md
#

hugo $@

#!/bin/sh
set -e
set -x

git submodule update -f --init --recursive

cd cloned
if [[ ! -d cue/ ]] ; then
  git clone -n https://github.com/cuelang/cue
fi
cd cue
git checkout 317163484ec5d79259a4ea6524d3870419510639
cd ../..

PUSHD=$(pwd)
cat <<EOF > content/en/docs/references/spec.md
+++
title = "Language Specification"
+++
EOF
cat cloned/cue/doc/ref/spec.md >> content/en/docs/references/spec.md
cd content/en/docs/tutorials/tour
go test .
go run gen.go
cd ${PUSHD}

# TODO
#   shell documentation
#   cue/doc/contribute.md
#

hugo $@

Check for existence of previously checked-out cue repo
Check for existence of previously checked-out cue repo

The build.sh script currently fails if the directory where the cue source
is cloned into already exists. This is causing both annoyance
in working on the site and spurious test failures, i.e.

https://app.netlify.com/sites/cue/deploys/5e56e5d3ad333900082c4c36

> 1:41:01 PM: fatal: destination path 'cue' already exists and is not an empty directory.
