<commit_before>#!/bin/bash

function print_help {
    echo "Usage: $0 -p contiki_path -e exclude_regex"
    echo "When installing the driver feeds will be copied into the local repo to allow for" \
         "documentation generation with doxygen. When excluding/including different drivers" \
         "remember to clean your repo first"
    echo "-h: Show help"
    echo "-p: Path where the library will be installed (required on first install)"
    echo "-e: Regex to use for the find command when excluding headers and source files." \
         "The regex applies to the filename combined with the top level folder it's in," \
         "i.e. './click/*' will match all files in the click directory, while '*relay.*' will" \
         "match 'click/relay.c' and 'click/relay.h'"
    echo "-s: Skips the feed downloads and installs files stored locally"
    echo "-u: Uninstalls the library from Contiki folder"
}

# Courtesy of http://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx
# Fixes issues with Macos readlink -f lack of compatibility
realpath() {
    [[ "$1" = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}

function install_files {
    if [[ -d "$LMC_DIR" ]]; then
        rm -rf "$LMC_DIR"
    fi

    mkdir -p "$LMC_DIR"

    cp -r "$SRC_DIR"/* "$LMC_DIR/"
    cp -r "$INCLUDE_DIR"/* "$LMC_DIR/"

    if [[ -d "$STAGING_DIR" ]]; then
        cp -r "$STAGING_DIR"/* "$LMC_DIR/"
    fi

    local MAKEFILE="$CONTIKI/Makefile.include"
    local PLATFORM_MAIN="$CONTIKI/platform/mikro-e/contiki-mikro-e-main.c"
<commit_msg>Install: Modified realpath to give proper absolute paths<commit_after>#!/bin/bash

function print_help {
    echo "Usage: $0 -p contiki_path -e exclude_regex"
    echo "When installing the driver feeds will be copied into the local repo to allow for" \
         "documentation generation with doxygen. When excluding/including different drivers" \
         "remember to clean your repo first"
    echo "-h: Show help"
    echo "-p: Path where the library will be installed (required on first install)"
    echo "-e: Regex to use for the find command when excluding headers and source files." \
         "The regex applies to the filename combined with the top level folder it's in," \
         "i.e. './click/*' will match all files in the click directory, while '*relay.*' will" \
         "match 'click/relay.c' and 'click/relay.h'"
    echo "-s: Skips the feed downloads and installs files stored locally"
    echo "-u: Uninstalls the library from Contiki folder"
}

realpath() {
    cd -P "$1"
    echo "$PWD"
    cd - > /dev/null
}

function install_files {
    if [[ -d "$LMC_DIR" ]]; then
        rm -rf "$LMC_DIR"
    fi

    mkdir -p "$LMC_DIR"

    cp -r "$SRC_DIR"/* "$LMC_DIR/"
    cp -r "$INCLUDE_DIR"/* "$LMC_DIR/"

    if [[ -d "$STAGING_DIR" ]]; then
        cp -r "$STAGING_DIR"/* "$LMC_DIR/"
    fi

    local MAKEFILE="$CONTIKI/Makefile.include"
    local PLATFORM_MAIN="$CONTIKI/platform/mikro-e/contiki-mikro-e-main.c"

{'fraction_non_alphanumeric': 0.1249582358837287, 'fraction_numerical': 0.004343468092215168, 'mean_word_length': 2.818877551020408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3972143', 'n_tokens_mistral': 995, 'n_tokens_neox': 946, 'n_words': 345}