#!/usr/bin/env ion

# set path to include sn
let PATH=$HOME/.cargo/bin:$PATH

#export CLICOLOR=0
let CLICOLOR=0

# set to a suitable path & decide whether to produce reports
let reports = "false"
for x in @args
    if test $x = "+reports"
        let reports = "true"
    end
end

let path = $HOME/programming

# set the benches
let benches = ["sn all $path" "du -hcd2 $path" "sn all -d1 $path" "du -hcd1 $path" "sn all -f $path" "du -hacd2 $path" "sn all -d0 $path" "du -hs $path"]

# initialize cache
echo 'initializing file system cache...'
sn all ~/programming > /dev/null

#do the actual benchmarks
if test $reports = "true"
    echo 'generating reports with benchmarks...'
    mkdir -p reports/
    bench --output reports/all.html @benches
else
    bench @benches
end
