<commit_before>#!/bin/bash

CP=./lib/repoclean-1.0-SNAPSHOT.jar

for lib in `ls -1 ./lib | grep -v 'repoclean'`
do

  CP=$CP:./lib/$lib

done

cygwin=false
case "`uname`" in
  CYGWIN*) cygwin=true ;;
esac

if [ $cygwin == true ]; then
  CP=`cygpath -pw $CP`
fi

JAVA_OPTS=""

if [ "$1" == "profile" ]; then
  JAVA_OPTS="-agentlib:yjpagent=onexit=memory"
  # You need to customise this path for your environment
  export PATH=$PATH:/usr/local/yourkit/bin/win32
  shift
fi

if [ -z "$JAVA_HOME" ]; then
  JAVA_HOME=/usr/local/java

nice -n 19 $JAVA_HOME/bin/java -Xmx128M -Xms64M -Xincgc $JAVA_OPTS -classpath ${CP} org.apache.maven.tools.repoclean.Main $* | tee repoclean-log.txt<commit_msg>Added support for running repoclean from outside the repoclean dir.<commit_after>#!/bin/bash

mypath=`which $0`

echo "mypath: $mypath"

mydir=`pwd`

if [ "" != "$mypath" ]; then

  echo "Setting mydir based on mypath..."
  mydir=`dirname $mypath`

fi

echo "mydir: $mydir"

CP=$mydir/lib/repoclean-1.0-SNAPSHOT.jar

for lib in `ls -1 ./lib | grep -v 'repoclean'`
do

  CP=$CP:$mydir/lib/$lib

done

cygwin=false
case "`uname`" in
  CYGWIN*) cygwin=true ;;
esac

if [ $cygwin == true ]; then
  CP=`cygpath -pw $CP`
fi

JAVA_OPTS=""

if [ "$1" == "profile" ]; then
  JAVA_OPTS="-agentlib:yjpagent=onexit=memory"
  # You need to customise this path for your environment
  export PATH=$PATH:/usr/local/yourkit/bin/win32
  shift
fi

if [ -z "$JAVA_HOME" ]; then
  JAVA_HOME=/usr/local/java
fi

nice -n 19 $JAVA_HOME/bin/java -Xmx128M -Xms64M -Xincgc $JAVA_OPTS -classpath ${CP} org.apache.maven.tools.repoclean.Main $* | tee repoclean-log.txt
{'fraction_non_alphanumeric': 0.16154791154791154, 'fraction_numerical': 0.016584766584766583, 'mean_word_length': 3.8053097345132745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7548430', 'n_tokens_mistral': 746, 'n_tokens_neox': 695, 'n_words': 162}