<commit_before>/**
 ******************************************************************************
 * @file    settings.js
 * @author  <NAME> (<EMAIL>)
 * @company Particle ( https://www.particle.io/ )
 * @source https://github.com/spark/particle-cli
 * @version V1.0.0
 * @date    14-February-2014
 * @brief   Setting module
 ******************************************************************************
  Copyright (c) 2014 Spark Labs, Inc.  All rights reserved.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation, either
  version 3 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this program; if not, see <http://www.gnu.org/licenses/>.
  ******************************************************************************
 */


var fs = require('fs');
var path = require('path');
var extend = require('xtend');
var chalk = require('chalk');
var utilities = require('./lib/utilities.js');
var specs = require('./lib/deviceSpecs');

var settings = {
	commandPath: "./commands/",
	apiUrl: "https://api.particle.io",
	clientId: "CLI2",
	access_token: null,
	minimumApiDelay: 500,
	//useOpenSSL: true,
	useSudoForDfu: false,

	//2 megs -- this constant here is arbitrary
	MAX_FILE_SIZE: 1024 * 1024 * 2,

	overridesFile: null,
	wirelessSetupFilter: /^Photon-.*$/,

	notSourceExtensions: [
		".ds_store",
		".jpg",
		".gif",
		".png",
		".include",
		".ignore",
		".ds_store",
		".git",
		".bin"
	],
	showIncludedSourceFiles: true,

	dirIncludeFilename: "particle.include",
	dirExcludeFilename: "particle.ignore",

	knownApps: {
		"deep_update_2014_06": true,
		"cc3000": true,
		"cc3000_1_14": true,
		"tinker": true,
		"voodoo": true
	},
	updates: {
		"2b04:d006": {
			SystemFirmwareOne: "system-part1-0.4.3-photon.bin",
			SystemFirmwareTwo: "system-part2-0.4.3-photon.bin"
		},
		"2b04:d008": {
			SystemFirmwareOne: "system-part1-0.4.3-p1.bin",
			SystemFirmwareTwo: "system-part2-0.4.3-p1.bin"
		}
	},
	commandMappings: path.join(__dirname, "mappings.json")
};

//fix the paths on the known apps mappings
Object.keys(specs).forEach(function (id) {
	var deviceSpecs = specs[id];
	var knownApps = deviceSpecs["knownApps"];
	for(var appName in knownApps) {
		knownApps[appName] =  path.join(__dirname,"binaries", knownApps[appName]);
	};
});


settings.commandPath = __dirname + "/commands/";

settings.findHomePath = function() {
	var envVars = [
		'home',
		'HOME',
		'HOMEPATH',
		'USERPROFILE'
	];

	for(var i=0;i<envVars.length;i++) {<commit_msg>System firmware updates now at 0.4.4-rc.1<commit_after>/**
 ******************************************************************************
 * @file    settings.js
 * @author  <NAME> (<EMAIL>)
 * @company Particle ( https://www.particle.io/ )
 * @source https://github.com/spark/particle-cli
 * @version V1.0.0
 * @date    14-February-2014
 * @brief   Setting module
 ******************************************************************************
  Copyright (c) 2014 Spark Labs, Inc.  All rights reserved.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation, either
  version 3 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this program; if not, see <http://www.gnu.org/licenses/>.
  ******************************************************************************
 */


var fs = require('fs');
var path = require('path');
var extend = require('xtend');
var chalk = require('chalk');
var utilities = require('./lib/utilities.js');
var specs = require('./lib/deviceSpecs');

var settings = {
	commandPath: "./commands/",
	apiUrl: "https://api.particle.io",
	clientId: "CLI2",
	access_token: null,
	minimumApiDelay: 500,
	//useOpenSSL: true,
	useSudoForDfu: false,

	//2 megs -- this constant here is arbitrary
	MAX_FILE_SIZE: 1024 * 1024 * 2,

	overridesFile: null,
	wirelessSetupFilter: /^Photon-.*$/,

	notSourceExtensions: [
		".ds_store",
		".jpg",
		".gif",
		".png",
		".include",
		".ignore",
		".ds_store",
		".git",
		".bin"
	],
	showIncludedSourceFiles: true,

	dirIncludeFilename: "particle.include",
	dirExcludeFilename: "particle.ignore",

	knownApps: {
		"deep_update_2014_06": true,
		"cc3000": true,
		"cc3000_1_14": true,
		"tinker": true,
		"voodoo": true
	},
	updates: {
		"2b04:d006": {
			SystemFirmwareOne: "system-part1-0.4.4-rc.1-photon.bin",
			SystemFirmwareTwo: "system-part2-0.4.4-rc.1-photon.bin"
		},
		"2b04:d008": {
			SystemFirmwareOne: "system-part1-0.4.4-rc.1-p1.bin",
			SystemFirmwareTwo: "system-part2-0.4.4-rc.1-p1.bin"
		}
	},
	commandMappings: path.join(__dirname, "mappings.json")
};

//fix the paths on the known apps mappings
Object.keys(specs).forEach(function (id) {
	var deviceSpecs = specs[id];
	var knownApps = deviceSpecs["knownApps"];
	for(var appName in knownApps) {
		knownApps[appName] =  path.join(__dirname,"binaries", knownApps[appName]);
	};
});


settings.commandPath = __dirname + "/commands/";

settings.findHomePath = function() {
	var envVars = [
		'home',
		'HOME',
		'HOMEPATH',
		'USERPROFILE'
	];

	for(var i=0;i<envVars.length;i++) {
{'fraction_non_alphanumeric': 0.21280921721450355, 'fraction_numerical': 0.027109454422229753, 'mean_word_length': 4.2424511545293075, 'pattern_counts': {'":': 14, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, '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': '5722154', 'n_tokens_mistral': 2110, 'n_tokens_neox': 1903, 'n_words': 515}