#!/bin/bash
set -e

echo "Updating..."
cd ./modstorage
MODS=$(find -maxdepth 1 -name "*.jar" | sed "s/^.\{2\}//g")

cd ..
rm modindex.packutil # i hate my life
echo -e "$MODS" >> modindex.packutil
echo "Updated index! Found $(wc -l ./modindex.packutil) mod(s)"
