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, };