<commit_before>const opn	= require('opn');
const fs	= require('fs');

angular.module('termApp')
	.directive('localRef', () => {

		return {
			scope: {
				localRef: '='
			},
			controller:
				function localRef($scope, commandService, $element) {
					$element.on('click', () => {
						fs.stat($scope.localRef, (err, stat) => {
							if (stat.isDirectory()) {
								commandService.execute(`#cd "${
									$scope.localRef
										.replace(/\\/g,
											'\\\\'
										)
								}"`);
							}
							else {
								opn($scope.localRef);
							}

						});
					});
				}
		}
});<commit_msg>Fix to local ref<commit_after>const opn	= require('opn');
const fs	= require('fs');

angular.module('termApp')
	.directive('localRef', () => {

		return {
			scope: {
				localRef: '='
			},
			controller:
				function localRef($scope, commandService, $element) {
					$element.on('click', () => {
						fs.stat($scope.localRef, (err, stat) => {
							let path = $scope.localRef
								.replace(/\\/g,
									'\\\\'
								);

							if (stat.isDirectory()) {
								commandService.execute(`#cd "${
									path
								}"`);
							}
							else {
								opn(path);
							}

						});
					});
				}
		}
});
{'fraction_non_alphanumeric': 0.19950940310711365, 'fraction_numerical': 0.0, 'mean_word_length': 1.7881548974943053, 'pattern_counts': {'":': 0, '<': 3, '<?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': '333754', 'n_tokens_mistral': 642, 'n_tokens_neox': 408, 'n_words': 60}