<commit_before>#!/bin/sh

set -o errexit

die() {
  echo $*
  exit 1
}

if [ $# -ne 1 ]; then
  die "Output directory required"
fi
outdir="$1"

# Check if npm, bower and gulp can be found in PATH.
for p in npm bower gulp; do
  if [ ! -f $(which $p 2>/dev/null) ]; then
    die "\`$p\` not found in \$PATH"
  fi
done

# Directory definitions
basedir="$(pwd)"
bowerdir="$basedir/bower_components"
semanticdir="$bowerdir/semantic"
builddir="$semanticdir/dist"

# Download semantic-ui
bower install semantic
cd "$semanticdir"
npm install --ignore-scripts

# Configure semantic-ui
cp "$basedir/rc/semantic.json" .
cp src/theme.config.example src/theme.config
cp -R src/_site src/site
cp "$basedir/rc/site.variables" src/site/globals

# Build semantic-ui
gulp build
cd "$basedir"

# Install semantic-ui
mkdir -p "$outdir"

cp -R js css img "$outdir"
cp *.html *.json "$outdir"

cp "$builddir/semantic.min.js" "$outdir/js"
cp "$builddir/semantic.min.css" "$outdir/css"
mkdir "$outdir/css/themes"
cp -R "$builddir/themes/default" "$outdir/css/themes"

# Install jquery (gets fetched as a dependency of semantic-ui anyway)
cp "$bowerdir/jquery/dist/jquery.min.js" "$outdir/js"
<commit_msg>build.sh: always use `mkdir -p`<commit_after>#!/bin/sh

set -o errexit

die() {
  echo $*
  exit 1
}

if [ $# -ne 1 ]; then
  die "Output directory required"
fi
outdir="$1"

# Check if npm, bower and gulp can be found in PATH.
for p in npm bower gulp; do
  if [ ! -f $(which $p 2>/dev/null) ]; then
    die "\`$p\` not found in \$PATH"
  fi
done

# Directory definitions
basedir="$(pwd)"
bowerdir="$basedir/bower_components"
semanticdir="$bowerdir/semantic"
builddir="$semanticdir/dist"

# Download semantic-ui
bower install semantic
cd "$semanticdir"
npm install --ignore-scripts

# Configure semantic-ui
cp "$basedir/rc/semantic.json" .
cp src/theme.config.example src/theme.config
cp -R src/_site src/site
cp "$basedir/rc/site.variables" src/site/globals

# Build semantic-ui
gulp build
cd "$basedir"

# Install semantic-ui
mkdir -p "$outdir"

cp -R js css img "$outdir"
cp *.html *.json "$outdir"

cp "$builddir/semantic.min.js" "$outdir/js"
cp "$builddir/semantic.min.css" "$outdir/css"
mkdir -p "$outdir/css/themes"
cp -R "$builddir/themes/default" "$outdir/css/themes"

# Install jquery (gets fetched as a dependency of semantic-ui anyway)
cp "$bowerdir/jquery/dist/jquery.min.js" "$outdir/js"

{'fraction_non_alphanumeric': 0.15371692566148676, 'fraction_numerical': 0.0033599328013439733, 'mean_word_length': 4.014736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1927653', 'n_tokens_mistral': 930, 'n_tokens_neox': 880, 'n_words': 257}