<commit_before>#!/bin/bash

os=${OSTYPE//[0-9.]/}

# Get the full path of this script
if [[ ${0} == /* ]]; then
  full_path="$0"
else
  full_path="${PWD}/${0#./}"
fi

# Remove /scripts/download_deps.sh to get the root directory
root_dir=${full_path%/*/*}

#### CEF

cefVersion="3.1180.823"
if [ "$os" = "darwin" ]; then # Building on mac
    zipName="cef_binary_""$cefVersion""_macosx"
elif [ "$os" = "msys" ]; then # Building on win
    zipName="cef_binary_""$cefVersion""_windows"
fi

# See if we already have the correct version
if [ -f "$root_dir/deps/cef/$zipName.txt" ]; then
    echo "You already have the correct version of CEF downloaded."
    
else
    # nuke the old folder
    rm -rf "$root_dir/deps/cef"
    
    echo "Downloading CEF binary distribution"
    curl -# "http://chromiumembedded.googlecode.com/files/$zipName.zip" > tmp.zip
    
    echo "Extracting ZIP file"
    unzip -q tmp.zip -d "$root_dir/deps"
    rm tmp.zip
    
    # Rename
    mv "$root_dir/deps/$zipName" "$root_dir/deps/cef"
    
    # Write a text file with the zip name 
    echo "$zipName" > "$root_dir/deps/cef/$zipName.txt"
    
    # Make the symlinks
    pushd "$root_dir"
    if [ "$os" = "msys" ]; then
        # Call batch file to make directory junctions
        cmd.exe /c "scripts\make_symlinks.bat"
    else
        rm Debug include libcef_dll Release Resources tools
        
        # Make symlinks to deps/cef directories
        ln -s deps/cef/Debug/ Debug
        ln -s deps/cef/include/ include
        ln -s deps/cef/libcef_dll/ libcef_dll
        ln -s deps/cef/Release/ Release
        ln -s deps/cef/Resources/ Resources
        ln -s deps/cef/tools/ tools

        # Make sure scripts in deps/cef/tools are executable
        chmod u+x deps/cef/tools/*
    fi
    popd
fi

#### NODE

nodeVersion="0.8.19"
npmVersion="1.2.10"

# See if we already have the correct version
if [ -f "$root_dir/deps/node/version-$nodeVersion.txt" ]; then
    echo "You already have the correct version of Node downloaded."

else
    # nuke the old folder
    rm -rf "$root_dir/deps/node"
    
    if [ "$os" = "darwin" ]; then # Building on mac
        echo "Downloading Node"
        curl -# "http://nodejs.org/dist/v$nodeVersion/node-v$nodeVersion-darwin-x86.tar.gz" > tmp.tar.gz
        echo "Extracting tar file"
        tar -xzf tmp.tar.gz
        rm tmp.tar.gz
        mv "node-v$nodeVersion-darwin-x86" "$root_dir/deps/node"
        echo "$nodeVersion" > "$root_dir/deps/node/version-$nodeVersion.txt"
    elif [ "$os" = "msys" ]; then # Building on win
        echo "Downloading Node"
        mkdir "$root_dir/deps/node"
        curl -# "http://nodejs.org/dist/v$nodeVersion/node.exe" -o "$root_dir/deps/node/node.exe"

        echo "Downloading NPM"
        curl -# "http://nodejs.org/dist/npm/npm-$npmVersion.zip" > tmp.zip
        
        echo "Extracting ZIP file"
        unzip -q tmp.zip -d "$root_dir/deps/node"
        rm tmp.zip
        
        echo "$nodeVersion" > "$root_dir/deps/node/version-$nodeVersion.txt"<commit_msg>update to node 0.8.20 and npm 1.2.11<commit_after>#!/bin/bash

os=${OSTYPE//[0-9.]/}

# Get the full path of this script
if [[ ${0} == /* ]]; then
  full_path="$0"
else
  full_path="${PWD}/${0#./}"
fi

# Remove /scripts/download_deps.sh to get the root directory
root_dir=${full_path%/*/*}

#### CEF

cefVersion="3.1180.823"
if [ "$os" = "darwin" ]; then # Building on mac
    zipName="cef_binary_""$cefVersion""_macosx"
elif [ "$os" = "msys" ]; then # Building on win
    zipName="cef_binary_""$cefVersion""_windows"
fi

# See if we already have the correct version
if [ -f "$root_dir/deps/cef/$zipName.txt" ]; then
    echo "You already have the correct version of CEF downloaded."
    
else
    # nuke the old folder
    rm -rf "$root_dir/deps/cef"
    
    echo "Downloading CEF binary distribution"
    curl -# "http://chromiumembedded.googlecode.com/files/$zipName.zip" > tmp.zip
    
    echo "Extracting ZIP file"
    unzip -q tmp.zip -d "$root_dir/deps"
    rm tmp.zip
    
    # Rename
    mv "$root_dir/deps/$zipName" "$root_dir/deps/cef"
    
    # Write a text file with the zip name 
    echo "$zipName" > "$root_dir/deps/cef/$zipName.txt"
    
    # Make the symlinks
    pushd "$root_dir"
    if [ "$os" = "msys" ]; then
        # Call batch file to make directory junctions
        cmd.exe /c "scripts\make_symlinks.bat"
    else
        rm Debug include libcef_dll Release Resources tools
        
        # Make symlinks to deps/cef directories
        ln -s deps/cef/Debug/ Debug
        ln -s deps/cef/include/ include
        ln -s deps/cef/libcef_dll/ libcef_dll
        ln -s deps/cef/Release/ Release
        ln -s deps/cef/Resources/ Resources
        ln -s deps/cef/tools/ tools

        # Make sure scripts in deps/cef/tools are executable
        chmod u+x deps/cef/tools/*
    fi
    popd
fi

#### NODE

nodeVersion="0.8.20"
npmVersion="1.2.11"

# See if we already have the correct version
if [ -f "$root_dir/deps/node/version-$nodeVersion.txt" ]; then
    echo "You already have the correct version of Node downloaded."

else
    # nuke the old folder
    rm -rf "$root_dir/deps/node"
    
    if [ "$os" = "darwin" ]; then # Building on mac
        echo "Downloading Node"
        curl -# "http://nodejs.org/dist/v$nodeVersion/node-v$nodeVersion-darwin-x86.tar.gz" > tmp.tar.gz
        echo "Extracting tar file"
        tar -xzf tmp.tar.gz
        rm tmp.tar.gz
        mv "node-v$nodeVersion-darwin-x86" "$root_dir/deps/node"
        echo "$nodeVersion" > "$root_dir/deps/node/version-$nodeVersion.txt"
    elif [ "$os" = "msys" ]; then # Building on win
        echo "Downloading Node"
        mkdir "$root_dir/deps/node"
        curl -# "http://nodejs.org/dist/v$nodeVersion/node.exe" -o "$root_dir/deps/node/node.exe"

        echo "Downloading NPM"
        curl -# "http://nodejs.org/dist/npm/npm-$npmVersion.zip" > tmp.zip
        
        echo "Extracting ZIP file"
        unzip -q tmp.zip -d "$root_dir/deps/node"
        rm tmp.zip
        
        echo "$nodeVersion" > "$root_dir/deps/node/version-$nodeVersion.txt"
{'fraction_non_alphanumeric': 0.13739957370060665, 'fraction_numerical': 0.009509755697655354, 'mean_word_length': 2.4135422495803023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7524079', 'n_tokens_mistral': 2256, 'n_tokens_neox': 2176, 'n_words': 551}