pre-makes appropriate directories before running a given command