<commit_before>'use strict';

var isCI = function() {
  return ['CI', 'TRAVIS', 'CONTINUOUS_INTEGRATION'].filter(function(variable) {
    return process.env[variable] === 'true';
  }).length > 0;
}

module.exports = function(grunt) {
  // we need to jump this hoop so we can load our dependencies
  // and use their tasks
  var cwd = process.cwd();
  process.chdir(__dirname + '/..');
  grunt.loadNpmTasks('grunt-tx');
  grunt.loadNpmTasks('grunt-angular-gettext');
  process.chdir(cwd);

  grunt.registerTask('ng-gettext-transifex-upload', function() {
    if (!isCI()) {
      grunt.fatal('Not allowed in a non-CI environment. Run with CI=true to override this.');
    }

    grunt.task.run('nggettext_extract', 'tx:upload');
  });

  grunt.registerTask('ng-gettext-transifex-download', [
    'tx:download',
    'nggettext_compile'
  ]);
}<commit_msg>feat(upload): link to argumentation why non-CI upload is disabled by default<commit_after>'use strict';

var isCI = function() {
  return ['CI', 'TRAVIS', 'CONTINUOUS_INTEGRATION'].filter(function(variable) {
    return process.env[variable] === 'true';
  }).length > 0;
}

module.exports = function(grunt) {
  // we need to jump this hoop so we can load our dependencies
  // and use their tasks
  var cwd = process.cwd();
  process.chdir(__dirname + '/..');
  grunt.loadNpmTasks('grunt-tx');
  grunt.loadNpmTasks('grunt-angular-gettext');
  process.chdir(cwd);

  grunt.registerTask('ng-gettext-transifex-upload', function() {
    if (!isCI()) {
      grunt.fatal('Not allowed in a non-CI environment, read https://github.com/eHealthAfrica/grunt-angular-gettext-transifex#workflow. Run with CI=true to override this.');
    }

    grunt.task.run('nggettext_extract', 'tx:upload');
  });

  grunt.registerTask('ng-gettext-transifex-download', [
    'tx:download',
    'nggettext_compile'
  ]);
}
{'fraction_non_alphanumeric': 0.16387236343969713, 'fraction_numerical': 0.001081665765278529, 'mean_word_length': 4.0271739130434785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5610114', 'n_tokens_mistral': 644, 'n_tokens_neox': 632, 'n_words': 132}