tasks/shopify_theme_settings.js
function getCombinedTemplateDirectory(templateDirectories) {
    // Automatically track and clean up files at exit.
    temp.track();

    // Create a temporary directory to hold our template files.
    var combinedTemplateDirectory = temp.mkdirSync('templates');

    // Copy templates from our source directories into the combined directory.
    templateDirectories.reverse().forEach(function(templateDirectory) {
      grunt.file.expand(path.join(templateDirectory, '*.html')).forEach(function(srcPath) {
        var srcFilename = path.basename(srcPath),
            destPath = path.join(combinedTemplateDirectory, srcFilename);
        grunt.file.copy(srcPath, destPath);
      });
    });

    return combinedTemplateDirectory;
  }
function getCombinedTemplateDirectory(templateDirectories) {
    // Automatically track and clean up files at exit.
    temp.track();

    // Create a temporary directory to hold our template files.
    var combinedTemplateDirectory = temp.mkdirSync('templates');

    // Copy templates from our source directories into the combined directory.
    templateDirectories.reverse().forEach(function(templateDirectory) {
      grunt.file.expand(path.join(templateDirectory, '*.html')).forEach(function(srcPath) {
        var srcFilename = path.basename(srcPath),
            destPath = path.join(combinedTemplateDirectory, srcFilename);
        grunt.file.copy(srcPath, destPath);
      });
    });

    return combinedTemplateDirectory;
  }
function getCombinedTemplateDirectory ( templateDirectories ) { // Automatically track and clean up files at exit. temp . track ( ) ; // Create a temporary directory to hold our template files. var combinedTemplateDirectory = temp . mkdirSync ( 'templates' ) ; // Copy templates from our source directories into the combined directory. templateDirectories . reverse ( ) . forEach ( function ( templateDirectory ) { grunt . file . expand ( path . join ( templateDirectory , '*.html' ) ) . forEach ( function ( srcPath ) { var srcFilename = path . basename ( srcPath ) , destPath = path . join ( combinedTemplateDirectory , srcFilename ) ; grunt . file . copy ( srcPath , destPath ) ; } ) ; } ) ; return combinedTemplateDirectory ; }
Given a list of template directories, compile them into a single template directory.
Templates with the same name will be overridden, with preference given to those first in the list.

@param templateDirectories
@return string
Given a list of template directories compile them into a single template directory . Templates with the same name will be overridden with preference given to those first in the list .