Move the dry run logic for file handling farther up
Move the dry run logic for file handling farther up

This reduces the chance that other things will do destructive modifications
on the file system in a dry run.

per-gron/shuriken,per-gron/shuriken,per-gron/shuriken,per-gron/shuriken