<commit_before>/**
 * Module dependencies
 */

var util = require('util')
	, path = require('path')
	, _ = require('lodash');

// Make _.defaults recursive
_.defaults = require('merge-defaults');




/**
 * This `before` function is run before generating targets.
 * Validate, configure defaults, get extra dependencies, etc.
 *
 * @param  {Object} scope
 * @param  {Function} cb    [callback]
 */

module.exports = function(scope, cb) {

	//
	// scope.args are the raw command line arguments.
	//
	// e.g. if you run:
	// sails generate controlller user find create update
	// then:
	// scope.args = ['user', 'find', 'create', 'update']
	//


	// Look at arguments and set path to adapters (i.e. `:adaptersPath`)
	if (scope.args) {
		if (scope.args[0]) {

			if (!scope.adapterType) {
				scope.adapterType = scope.args[0];
			}

			// Determine path to adapters
			var DEFAULT_ADAPTERS_PATH = 'api/adapters';
			scope.adaptersPath = path.join(DEFAULT_ADAPTERS_PATH, scope.adapterType);
		}
	}

	// Use `adapterType` instead of `adapterName` if it's specified.
	scope.adapterName = scope.adapterType || scope.adapterName;
	scope.adapterType = scope.adapterType || scope.adapterName;


	//
	// Validate custom scope variables which
	// are required by this generator.<commit_msg>Fixed scope variables so that console message will be correct after generating adapter.<commit_after>/**
 * Module dependencies
 */

var util = require('util')
	, path = require('path')
	, _ = require('lodash');

// Make _.defaults recursive
_.defaults = require('merge-defaults');




/**
 * This `before` function is run before generating targets.
 * Validate, configure defaults, get extra dependencies, etc.
 *
 * @param  {Object} scope
 * @param  {Function} cb    [callback]
 */

module.exports = function(scope, cb) {

	//
	// scope.args are the raw command line arguments.
	//
	// e.g. if you run:
	// sails generate controlller user find create update
	// then:
	// scope.args = ['user', 'find', 'create', 'update']
	//


	// Look at arguments and set path to adapters (i.e. `:adaptersPath`)
	if (scope.args) {
		if (scope.args[0]) {

			if (!scope.adapterType) {
				scope.adapterType = scope.args[0];
			}

			// Determine path to adapters
			var DEFAULT_ADAPTERS_PATH = 'api/adapters';
			scope.adaptersPath = path.join(DEFAULT_ADAPTERS_PATH, scope.adapterType);
		}
	}

	// Use `adapterType` instead of `adapterName` if it's specified.
	scope.adapterName = scope.adapterType || scope.adapterName;
	scope.adapterType = scope.adapterType || scope.adapterName;
	scope.adapterMainFile = scope.adapterName+'Adapter';
	scope.id = scope.adapterName;
	scope.globalID = scope.adapterMainFile;
	scope.destDir = 'api/adapters/'+scope.adapterName+'/';

	//
	// Validate custom scope variables which
	// are required by this generator.
{'fraction_non_alphanumeric': 0.14041948098115892, 'fraction_numerical': 0.0014219694276573053, 'mean_word_length': 3.466666666666667, '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': '7268123', 'n_tokens_mistral': 934, 'n_tokens_neox': 864, 'n_words': 249}