Code snippets

Generate spacecraft assets

  local.log('Generate spacecraft assets');
  local.exec('cd ' + config.themeFolder + '/spacecraft && gulp assets');

Copy files

  local.log('Copying icons folder');
  local.exec('rm -rf ./icons');
  local.exec('cp -r ' + config.themeFolder + '/assets/icons ./icons');

Select files to sync to the remote server

  let ignoredFilesAndFolders = [
    'grep -v node_modules',
    'grep -v "sites/default"',
    'grep -v spacecraft',
  ];
  let grep = ignoredFilesAndFolders.toString().replace(/,/g, ' | ');

  let files = local.find('icons img autoload.php core export index.php modules profiles robots.txt sites themes update.php vendor web.config -type f | ' + grep, {
    silent: true,
    exec: {
      maxBuffer: 10000 * 1024
    }
  });

Add additional files or folders

  let components = local.find('sites/all/themes/akademssr/spacecraft/views -name "*.twig"', {
    silent: true
  });

  files.stdout += components.stdout;