<commit_before>
'use strict';

module.exports = function(kbox, app) {

  var id = kbox.core.deps.get('globalConfig').engineId;
  var group = kbox.core.deps.get('globalConfig').engineGid;

  /*
   * Helper to get a appserver run def template
   */
  var getAppRunner = function() {
    return {
      compose: app.composeCore,
      project: app.name,
      opts: {
        services: ['appserver']
      }
    };
  };

  /*
   * Wordpress post-create setup function
   */
  kbox.core.events.on('post-create-app', function(app, done) {

    // Only run this when app type is php.
    if (app.config.type === 'php') {

      // Chown wp directory
      var chownDrupal = getAppRunner();
      chownDrupal.opts.entrypoint = 'chown';
      chownDrupal.opts.cmd = [
        '-R',
        [id, group].join(':'),
        '/usr/src/wordpress'
      ];
      return kbox.engine.run(chownDrupal)

      // Finish up
      .nodeify(done);

    } else {

      // Make sure to return a promise and respect the done callback.
      return kbox.Promise.resolve().nodeify(done);

    }


  });

};<commit_msg>#1167: CS things<commit_after>
'use strict';

module.exports = function(kbox, app) {

  var id = kbox.core.deps.get('globalConfig').engineId;
  var group = kbox.core.deps.get('globalConfig').engineGid;

  /*
   * Helper to get a appserver run def template
   */
  var getAppRunner = function() {
    return {
      compose: app.composeCore,
      project: app.name,
      opts: {
        services: ['appserver']
      }
    };
  };

  /*
   * Wordpress post-create setup function
   */
  kbox.core.events.on('post-create-app', function(app, done) {

    // Only run this when app type is php.
    if (app.config.type === 'php') {

      // Chown wp directory
      var chownDrupal = getAppRunner();
      chownDrupal.opts.entrypoint = 'chown';
      chownDrupal.opts.cmd = [
        '-R',
        [id, group].join(':'),
        '/usr/src/wordpress'
      ];
      return kbox.engine.run(chownDrupal)

      // Finish up
      .nodeify(done);

    } else {

      // Make sure to return a promise and respect the done callback.
      return kbox.Promise.resolve().nodeify(done);

    }

  });

};
{'fraction_non_alphanumeric': 0.1453382084095064, 'fraction_numerical': 0.0018281535648994515, 'mean_word_length': 2.181686046511628, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3862709', 'n_tokens_mistral': 749, 'n_tokens_neox': 721, 'n_words': 164}