<commit_before>var fs = require('fs');
var os = require('os');
var path = require('path');

var dirs = [];
dirs.push('/usr/local/share/arduino');
dirs.push('/usr/share/arduino')

if(os.platform() === 'darwin'){
  dirs.push('/Applications/Arduino.app/Contents/Resources/Java');
}

var ArduinoEnv = module.exports = function(){
  this.rootDir = '';
  this.version = null;
  this.platformPath = '';
  this.compilerPath = '';
  this.corePath = '';
  this.variantPath = '';
}

ArduinoEnv.prototype.init = function(root){
  this.rootDir = (root) ? root : this._locateRoot();
  this.version = this.getVersion();
};

ArduinoEnv.prototype._locateRoot = function(){
  var found = '';
  dirs.some(function(dir){
    if(fs.existsSync(dir)){
      found = dir;
      return true;
    }<commit_msg>Added scan directories for arduino on windows.<commit_after>var fs = require('fs');
var os = require('os');
var path = require('path');

var dirs = [];
dirs.push('/usr/local/share/arduino');
dirs.push('/usr/share/arduino')

if(os.platform() === 'darwin'){
  dirs.push('/Applications/Arduino.app/Contents/Resources/Java');
} else if(os.platform() === 'win32'){
  dirs.push('C:\\Program Files (x86)\\Arduino');
  dirs.push('C:\\Program Files\\Arduino');
}

var ArduinoEnv = module.exports = function(){
  this.rootDir = '';
  this.version = null;
  this.platformPath = '';
  this.compilerPath = '';
  this.corePath = '';
  this.variantPath = '';
}

ArduinoEnv.prototype.init = function(root){
  this.rootDir = (root) ? root : this._locateRoot();
  this.version = this.getVersion();
};

ArduinoEnv.prototype._locateRoot = function(){
  var found = '';
  dirs.some(function(dir){
    if(fs.existsSync(dir)){
      found = dir;
      return true;
    }
{'fraction_non_alphanumeric': 0.19584055459272098, 'fraction_numerical': 0.002310803004043905, 'mean_word_length': 3.9913544668587897, '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': '4966659', 'n_tokens_mistral': 612, 'n_tokens_neox': 594, 'n_words': 104}