<commit_before>#!/usr/bin/env bash
#
# Copyright (c) 2009-2012 VMware, Inc.

set -e

base_dir=$(readlink -nf $(dirname $0)/../..)
source ${base_dir}/lib/prelude_apply.bash

micro_src=${HOME}/micro
now=`date +%Y%m%d-%H%M%S`
dest_dir=mcf/$now
archive_dir_name=micro
archive_dir=${dest_dir}/${archive_dir_name}
mkdir --parents ${archive_dir}

if [[ -z "$MCF_VERSION" ]]; then
    MCF_VERSION="dev build $now"
    echo 'To build a release version, set the MCF_VERSION environment variable.'
fi

${image_vsphere_ovf_ovftool_path} \
    --extraConfig:displayname="Micro Cloud Foundry v${MCF_VERSION}" \
    ${work}/vsphere/image.ovf \
    ${archive_dir}/micro

cp ${micro_src}/micro/README ${archive_dir}
cp ${micro_src}/micro/RELEASE_NOTES ${archive_dir}

cd ${dest_dir}
zip --recurse-paths micro.zip ${archive_dir_name}
<commit_msg>Fix MCF_VERSION check so it works with bash nounset.<commit_after>#!/usr/bin/env bash
#
# Copyright (c) 2009-2012 VMware, Inc.

set -e

base_dir=$(readlink -nf $(dirname $0)/../..)
source ${base_dir}/lib/prelude_apply.bash

micro_src=${HOME}/micro
now=`date +%Y%m%d-%H%M%S`
dest_dir=mcf/$now
archive_dir_name=micro
archive_dir=${dest_dir}/${archive_dir_name}
mkdir --parents ${archive_dir}

if [ -z "${MCF_VERSION:-}" ]; then
    MCF_VERSION="dev build $now"
    echo 'To build a release version, set the MCF_VERSION environment variable.'
fi

${image_vsphere_ovf_ovftool_path} \
    --extraConfig:displayname="Micro Cloud Foundry v${MCF_VERSION}" \
    ${work}/vsphere/image.ovf \
    ${archive_dir}/micro

cp ${micro_src}/micro/README ${archive_dir}
cp ${micro_src}/micro/RELEASE_NOTES ${archive_dir}

cd ${dest_dir}
zip --recurse-paths micro.zip ${archive_dir_name}

{'fraction_non_alphanumeric': 0.164407778432528, 'fraction_numerical': 0.01060695344725987, 'mean_word_length': 4.957894736842105, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4362583', 'n_tokens_mistral': 679, 'n_tokens_neox': 627, 'n_words': 132}