Ensure directory exists for scripts generating target paths