Minor refactor: create a function which detects if a link step needs to run.

This is just a little cleaner than having two function calls doing the same thing except for the files being checked.