Abstract the package script's filesystem chores to a separate file for reuse