From fd657fc4a80c0f4e2b8ec20b4b92d293d3a970be Mon Sep 17 00:00:00 2001 From: davidwells Date: Tue, 23 May 2017 19:57:22 -0700 Subject: [PATCH] update config --- lib/utils/config/index.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/utils/config/index.js b/lib/utils/config/index.js index d471d8683..bf0cc646f 100644 --- a/lib/utils/config/index.js +++ b/lib/utils/config/index.js @@ -8,24 +8,16 @@ const writeFileAtomic = require('write-file-atomic'); const getFrameworkId = require('../getFrameworkId'); const fileExistsSync = require('../fs/fileExistsSync'); const readFileSync = require('../fs/readFileSync'); -const getServerlessDir = require('../getServerlessDir'); +const isTrackingDisabled = require('../isTrackingDisabled'); const globalConfigPath = path.join(os.homedir(), '.serverlessrc'); -function legacyIsTrackingDisabled() { - if (fileExistsSync(path.join(getServerlessDir(), 'stats-disabled'))) { - return true; - } - return false; -} - function createConfig() { // set default config options const config = { + userId: null, // currentUserId frameworkId: getFrameworkId(), - settings: { - trackingDisabled: legacyIsTrackingDisabled(), - }, + trackingDisabled: isTrackingDisabled(), }; writeFileAtomic.sync(globalConfigPath, JSON.stringify(config, null, 2)); return JSON.parse(readFileSync(globalConfigPath)); @@ -79,7 +71,7 @@ function deleteConfigValue(key) { } // set local config value /project/.serverlessrc -// function setLocalConfig +// function setLocalConfig() {} // set .serverlessrc config value function getConfigValue(objectPath) { @@ -95,5 +87,6 @@ module.exports = { get: getConfigValue, delete: deleteConfigValue, getConfig, + getGlobalConfig, CONFIG_FILE_PATH: globalConfigPath, };