#!/bin/sh

#If argument given, chdir into that directory
if [ -n "$1" ]
then
	cd "$1" || exit
fi
echo "Negativizing $PWD..."

# PNG files
for f in `find -iname '*-neg.png'`
do
	NORMAL=`echo "$f" | sed 's|-neg.png|.png|'`

	TARGET_BASE=`basename "$f"`

	ln -f -s "$TARGET_BASE" "$NORMAL"
done

# SVG files
for f in `find -iname '*-neg.svg'`
do
	NORMAL=`echo "$f" | sed 's|-neg.svg|.svg|'`

	TARGET_BASE=`basename "$f"`

	ln -f -s "$TARGET_BASE" "$NORMAL"
done
