Fix dist-directory only behavior being everywhere

The previous version of this script only used jarName once, hence the
confusion.