<commit_before>'use strict';

var watch = module.exports = {};

// var node_fs = require('fs');
var node_path       = require('path');
var multi_watcher   = require('multi-watcher');
var ignore          = require('ignore');
var pkg_helper      = require('../util/package');
var lang            = require('../util/lang');


// @param {Object} options
// - cwd: {Array.<path>}
watch.run = function(options, callback) {
    watch.watcher = multi_watcher({
        data_file: node_path.join( watch.context.profile.option('profile_root'), 'watcher_handle.js' )
    
    }).on('all', function (event, filepath) {
        // cortex commander will santitize filepath to the right root directory of the repo
        watch._rebuild(filepath);
    });

    options.stop ?
        watch.unwatch(options, callback) :
        watch.watch(options, callback);
};


watch.watch = function (options, callback) {
    var profile = watch.context.profile;<commit_msg>command/watch: fix reference error<commit_after>'use strict';

var watch = module.exports = {};

// var node_fs = require('fs');
var node_path       = require('path');
var multi_watcher   = require('multi-watcher');
var ignore          = require('ignore');
var pkg_helper      = require('../util/package');
var lang            = require('../util/lang');
var fs              = require('fs-sync');


// @param {Object} options
// - cwd: {Array.<path>}
watch.run = function(options, callback) {
    watch.watcher = multi_watcher({
        data_file: node_path.join( watch.context.profile.option('profile_root'), 'watcher_handle.js' )
    
    }).on('all', function (event, filepath) {
        // cortex commander will santitize filepath to the right root directory of the repo
        watch._rebuild(filepath);
    });

    options.stop ?
        watch.unwatch(options, callback) :
        watch.watch(options, callback);
};


watch.watch = function (options, callback) {
    var profile = watch.context.profile;
{'fraction_non_alphanumeric': 0.14987212276214834, 'fraction_numerical': 0.0, 'mean_word_length': 3.0164271047227924, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '311747', 'n_tokens_mistral': 578, 'n_tokens_neox': 568, 'n_words': 139}