<commit_before>#!/usr/bin/env bash

# Stop script on NZEC
set -e
# Stop script if unbound variable found (use ${var:-} if intentional)
set -u
# By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success
# This is causing it to fail
set -o pipefail

__PROJECT_DIR=${1:-}
__DOTNET_CMD=${2:-}
__TOOLRUNTIME_DIR=${3:-}
__PACKAGES_DIR=${4:-$__TOOLRUNTIME_DIR}
__TOOLS_DIR=$(cd "$(dirname "$0")"; pwd -P)
__MICROBUILD_VERSION=0.2.0
__PORTABLETARGETS_VERSION=0.1.1-dev

# Determine if the CLI supports MSBuild projects. This controls whether csproj files are used for initialization and package restore.
__CLI_VERSION=`$__DOTNET_CMD --version`
# Check the first character in the version string. Version 2 and above supports MSBuild.
__CLI_VERSION=${__CLI_VERSION:0:1}
if [ "$__CLI_VERSION" -ge "2" ]; then
  BUILDTOOLS_USE_CSPROJ=true
fi

if [ -z "${__BUILDTOOLS_USE_CSPROJ}" ]; then
    __PORTABLETARGETS_PROJECT_CONTENT="
{
  \"dependencies\":
  {
    \"MicroBuild.Core\": \"${__MICROBUILD_VERSION}\",
    \"Microsoft.Portable.Targets\": \"${__PORTABLETARGETS_VERSION}\"
  },
  \"frameworks\": {\"netcoreapp1.0\": {},\"net46\": {}
  }
}"
else
    __PORTABLETARGETS_PROJECT_CONTENT="<commit_msg>Fix use of uninitialized variable in init-tools.sh<commit_after>#!/usr/bin/env bash

# Stop script on NZEC
set -e
# Stop script if unbound variable found (use ${var:-} if intentional)
set -u
# By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success
# This is causing it to fail
set -o pipefail

__PROJECT_DIR=${1:-}
__DOTNET_CMD=${2:-}
__TOOLRUNTIME_DIR=${3:-}
__PACKAGES_DIR=${4:-$__TOOLRUNTIME_DIR}
__TOOLS_DIR=$(cd "$(dirname "$0")"; pwd -P)
__MICROBUILD_VERSION=0.2.0
__PORTABLETARGETS_VERSION=0.1.1-dev

# Determine if the CLI supports MSBuild projects. This controls whether csproj files are used for initialization and package restore.
__CLI_VERSION=`$__DOTNET_CMD --version`
# Check the first character in the version string. Version 2 and above supports MSBuild.
__CLI_VERSION=${__CLI_VERSION:0:1}
if [ "$__CLI_VERSION" -ge "2" ]; then
  BUILDTOOLS_USE_CSPROJ=true
fi

if [ -z "${__BUILDTOOLS_USE_CSPROJ:-}" ]; then
    __PORTABLETARGETS_PROJECT_CONTENT="
{
  \"dependencies\":
  {
    \"MicroBuild.Core\": \"${__MICROBUILD_VERSION}\",
    \"Microsoft.Portable.Targets\": \"${__PORTABLETARGETS_VERSION}\"
  },
  \"frameworks\": {\"netcoreapp1.0\": {},\"net46\": {}
  }
}"
else
    __PORTABLETARGETS_PROJECT_CONTENT="
{'fraction_non_alphanumeric': 0.1419828641370869, 'fraction_numerical': 0.018767849857201143, 'mean_word_length': 4.866028708133971, 'pattern_counts': {'":': 12, '<': 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': '4553198', 'n_tokens_mistral': 901, 'n_tokens_neox': 859, 'n_words': 227}