<commit_before>// Copyright 2017, University of Colorado Boulder

/* eslint-env node */
'use strict';

const constants = require( './constants' );
const devScp = require( '../common/devScp' );
const devSsh = require( '../common/devSsh' );
const execute = require( '../common/execute' );

/**
 * Copy files to dev server, typically spot.colorado.edu.
 *
 * @param simDir
 * @param simName
 * @param version
 * @param brands
 * @param api
 *
 * @return Promise
 */
module.exports = async function( simDir, simName, version, brands, api ) {
  const userAtServer = constants.BUILD_SERVER_CONFIG.devUsername + '@' + constants.BUILD_SERVER_CONFIG.devDeployServer;
  const simVersionDirectory = constants.BUILD_SERVER_CONFIG.devDeployPath + simName + '/' + version;

  // mkdir first in case it doesn't exist already
  await devSsh( 'mkdir -p ' + simVersionDirectory );
  const buildDir = simDir + '/build';

  const scpTarget = userAtServer + ':' + simVersionDirectory;

  // copy the files
  if ( api !== '1.0' ) {
    // TODO: filter out translations?
    await devScp( buildDir + '/*', scpTarget );
    if ( brands.indexOf( constants.PHET_IO_BRAND ) >= 0 ) {
      await devScp( buildDir + '/.htaccess', scpTarget + '/phet-io/wrappers/' );
    }
  }
  else {
    if ( brands.indexOf( constants.PHET_BRAND ) >= 0 ) {
      // copy english and all html and all non-html files
      await devScp( buildDir + '/' + simName + '_en.html ', scpTarget );
      await execute( 'find', [ '.', '-type', 'f', '!', '-iname', '\'*.html\'', '-exec', 'scp', '{}', scpTarget, '\\;' ], buildDir );
    }

    if ( brands.indexOf( constants.PHET_IO_BRAND ) >= 0 ) {
      await devScp( buildDir + '/*', scpTarget );
      await devScp( buildDir + '/.htaccess', scpTarget + '/wrappers/' );
    }

    if ( brands.indexOf( brands.indexOf( constants.PHET_BRAND ) < 0 && brands.indexOf( constants.PHET_IO_BRAND ) < 0 ) ) {
      await devScp( buildDir + '/*', scpTarget );
    }
  }
<commit_msg>updated execute calls<commit_after>// Copyright 2017, University of Colorado Boulder

/* eslint-env node */
'use strict';

const constants = require( './constants' );
const devScp = require( '../common/devScp' );
const devSsh = require( '../common/devSsh' );
const execute = require( '../common/execute' );

/**
 * Copy files to dev server, typically spot.colorado.edu.
 *
 * @param simDir
 * @param simName
 * @param version
 * @param brands
 * @param api
 *
 * @return Promise
 */
module.exports = async function( simDir, simName, version, brands, api ) {
  const userAtServer = constants.BUILD_SERVER_CONFIG.devUsername + '@' + constants.BUILD_SERVER_CONFIG.devDeployServer;
  const simVersionDirectory = constants.BUILD_SERVER_CONFIG.devDeployPath + simName + '/' + version;

  // mkdir first in case it doesn't exist already
  await devSsh( 'mkdir -p ' + simVersionDirectory );
  const buildDir = simDir + '/build';

  // copy the files
  if ( api !== '1.0' ) {
    // TODO: filter out translations?
    await execute( 'ls', [ '-la', buildDir ], '.' );
    await execute( 'ls', [ '-la', buildDir + '/*' ], '.' );
    await execute( 'pwd', [], buildDir );
    await devScp( buildDir + '/*', simVersionDirectory );
    if ( brands.indexOf( constants.PHET_IO_BRAND ) >= 0 ) {
      await devScp( buildDir + '/.htaccess', simVersionDirectory + '/phet-io/wrappers/' );
    }
  }
  else {
    if ( brands.indexOf( constants.PHET_BRAND ) >= 0 ) {
      // copy english and all html and all non-html files
      await devScp( buildDir + '/' + simName + '_en.html ', simVersionDirectory );
      await execute( 'find', [ '.', '-type', 'f', '!', '-iname', '\'*.html\'', '-exec', 'scp', '{}', simVersionDirectory, '\\;' ], buildDir );
    }

    if ( brands.indexOf( constants.PHET_IO_BRAND ) >= 0 ) {
      await devScp( buildDir + '/*', simVersionDirectory );
      await devScp( buildDir + '/.htaccess', simVersionDirectory + '/wrappers/' );
    }

    if ( brands.indexOf( brands.indexOf( constants.PHET_BRAND ) < 0 && brands.indexOf( constants.PHET_IO_BRAND ) < 0 ) ) {
      await devScp( buildDir + '/*', simVersionDirectory );
    }
  }

{'fraction_non_alphanumeric': 0.16723466407010712, 'fraction_numerical': 0.005355404089581304, 'mean_word_length': 3.1715736040609137, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3599616', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1348, 'n_words': 342}