Refs #18194 - Update build-templates script with latest changes

from hman fork