#!/bin/sh
#This needs to be executed inside the /public mod. Mod file will be generated at /mods.

echo "Name of the mod folder that will be created: "
read modname
mkdir ../$modname
echo "Version: "
read version
echo "Description of the mod: "
read description
echo "Website: "
read web

echo '{"name": "' $modname '","version": "' $version '","label": "' $modname '","url": "' $web '","description": "' $description '","dependencies": [],"type": "game"}' >> ../$modname/mod.json;

svn diff | grep Index: | cut -f 2 -d ' ' | while read line
do
	moddedpath=$(dirname $line)
	moddedfile=$(basename $line)
	
	mkdir -p ../$modname/$moddedpath
	cp $line ../$modname/$moddedpath/$moddedfile
done 
