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

MODEL=$1
YEAR=$2

if [ -z "$MODEL" ]
then
    echo "Swap to which vehicle model program? "
    read MODEL
fi

if [ -z "$YEAR" ]
then
    echo "Swap to which model year? "
    read YEAR
fi

FULL_MODEL="$MODEL-$YEAR"

HANDLERS=../../cansignals/$FULL_MODEL/handlers.cpp
SIGNALS=../../cansignals/build/$FULL_MODEL.cpp

pushd cantranslator > /dev/null
if [ ! -f $HANDLERS ]
then
    echo "Couldn't find the handlers file at $HANDLERS"
    echo "Did you run \"make\" in cansignals?"
    exit 1
fi

if [ ! -f $SIGNALS ]
then
    echo "Couldn't find the signals file at $SIGNALS"
    echo "Did you run \"make\" in cansignals?"
    exit 1
fi

KERNEL=`uname -o`

if [ "Cygwin" == $KERNEL ]
then
    # Normal UNIX-style symlinks can't be read in Windows, and if we try to use
    # Windows-style links, MPIDE just ignores all of those files. We have to
    # explicitly copy them to the directory.
    COPY_PROGRAM="cp -f"
    echo "It looks like you're using Cygwin. Symbolic links don't work in \
Windows, so this will copy the compiled files from the cansignals \
repository to the cantranslator folder."
    echo "If you recompile in cansignals, you will need to re-run swap.sh!"
else
    COPY_PROGRAM="ln -fs"
fi

$COPY_PROGRAM ../../cansignals/shared/handlers.cpp shared_handlers.cpp
$COPY_PROGRAM ../../cansignals/$FULL_MODEL/handlers.cpp handlers.cpp
$COPY_PROGRAM ../../cansignals/build/$FULL_MODEL.cpp signals.cpp

echo "Swapped to $FULL_MODEL."
popd > /dev/null<commit_msg>Use default output of uname to find OS (-o flag not in OS X).<commit_after>#!/usr/bin/env bash

MODEL=$1
YEAR=$2

if [ -z "$MODEL" ]
then
    echo "Swap to which vehicle model program? "
    read MODEL
fi

if [ -z "$YEAR" ]
then
    echo "Swap to which model year? "
    read YEAR
fi

FULL_MODEL="$MODEL-$YEAR"

HANDLERS=../../cansignals/$FULL_MODEL/handlers.cpp
SIGNALS=../../cansignals/build/$FULL_MODEL.cpp

pushd cantranslator > /dev/null
if [ ! -f $HANDLERS ]
then
    echo "Couldn't find the handlers file at $HANDLERS"
    echo "Did you run \"make\" in cansignals?"
    exit 1
fi

if [ ! -f $SIGNALS ]
then
    echo "Couldn't find the signals file at $SIGNALS"
    echo "Did you run \"make\" in cansignals?"
    exit 1
fi

KERNEL=`uname`

if [ "Cygwin" == $KERNEL ]
then
    # Normal UNIX-style symlinks can't be read in Windows, and if we try to use
    # Windows-style links, MPIDE just ignores all of those files. We have to
    # explicitly copy them to the directory.
    COPY_PROGRAM="cp -f"
    echo "It looks like you're using Cygwin. Symbolic links don't work in \
Windows, so this will copy the compiled files from the cansignals \
repository to the cantranslator folder."
    echo "If you recompile in cansignals, you will need to re-run swap.sh!"
else
    COPY_PROGRAM="ln -fs"
fi

$COPY_PROGRAM ../../cansignals/shared/handlers.cpp shared_handlers.cpp
$COPY_PROGRAM ../../cansignals/$FULL_MODEL/handlers.cpp handlers.cpp
$COPY_PROGRAM ../../cansignals/build/$FULL_MODEL.cpp signals.cpp

echo "Swapped to $FULL_MODEL."
popd > /dev/null
{'fraction_non_alphanumeric': 0.11785830884753509, 'fraction_numerical': 0.002611818478615736, 'mean_word_length': 3.197260273972603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6654874', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1066, 'n_words': 371}