<commit_before>echo Usage: build.sh [version]

if [ $# -eq 0 ]
then
    VERSION="latest"
else
    VERSION=$1
fi

NAME="flock-$VERSION"
NAMEMIN="flock-$VERSION-min"

if [ ! -d build ]
then
    mkdir build
fi

for f in "build/$NAME"*
do
    if [ -e $f ]
    then
        echo Removing "$f".
        rm $f
    fi
done

cat \
src/license.js \
src/flock.js \
src/utils.js \
src/path.js \
src/node.js \
src/single.js \
src/evented.js \
src/query.js \
src/multi.js \
> "build/$NAME.js"

if type yui-compressor >/dev/null 2>&1
then
    echo Minifying using YUI compressor.
    yui-compressor "build/$NAME.js" > build/tmp.js
elif type jsmin >/dev/null 2>&1
then
    echo Minifying using Jsmin.
    jsmin < "build/$NAME.js" > build/tmp.js
else
    echo No minifier found, skipping minification.
fi

if [ -f build/tmp.js ]
then
    cat src/license.js build/tmp.js > "build/$NAMEMIN.js"
    rm build/tmp.js

    echo Gzipping.
    gzip --stdout "build/$NAMEMIN.js" > "build/$NAMEMIN.js.gz"
fi

echo Done.
<commit_msg>js order fixed in build script<commit_after>echo Usage: build.sh [version]

if [ $# -eq 0 ]
then
    VERSION="latest"
else
    VERSION=$1
fi

NAME="flock-$VERSION"
NAMEMIN="flock-$VERSION-min"

if [ ! -d build ]
then
    mkdir build
fi

for f in "build/$NAME"*
do
    if [ -e $f ]
    then
        echo Removing "$f".
        rm $f
    fi
done

cat \
src/license.js \
src/utils.js \
src/path.js \
src/node.js \
src/single.js \
src/evented.js \
src/query.js \
src/multi.js \
src/flock.js \
> "build/$NAME.js"

if type yui-compressor >/dev/null 2>&1
then
    echo Minifying using YUI compressor.
    yui-compressor "build/$NAME.js" > build/tmp.js
elif type jsmin >/dev/null 2>&1
then
    echo Minifying using Jsmin.
    jsmin < "build/$NAME.js" > build/tmp.js
else
    echo No minifier found, skipping minification.
fi

if [ -f build/tmp.js ]
then
    cat src/license.js build/tmp.js > "build/$NAMEMIN.js"
    rm build/tmp.js

    echo Gzipping.
    gzip --stdout "build/$NAMEMIN.js" > "build/$NAMEMIN.js.gz"
fi

echo Done.

{'fraction_non_alphanumeric': 0.14405525407005426, 'fraction_numerical': 0.0059200789343857915, 'mean_word_length': 2.4726027397260273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '269203', 'n_tokens_mistral': 816, 'n_tokens_neox': 801, 'n_words': 209}