From 31deca47294b8aa5b1efa15732291c50b1bf4a5f Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Mon, 29 Oct 2018 19:13:04 +0100 Subject: [PATCH] Defaults dont belong in environment variables --- cmd/cmd.js | 1 - cmd/dashboard/command_history.js | 3 +-- lib/modules/console/index.js | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/cmd.js b/cmd/cmd.js index 21f8f15ab..1cd85cf2f 100644 --- a/cmd/cmd.js +++ b/cmd/cmd.js @@ -26,7 +26,6 @@ if (!process.env.PKG_PATH) { } process.env.DEFAULT_DIAGRAM_PATH = utils.joinPath(process.env.DAPP_PATH, 'diagram.svg'); -process.env.DEFAULT_CMD_HISTORY_PATH = utils.joinPath(process.env.DAPP_PATH, '.embark', 'cmd_history'); process.env.DEFAULT_CMD_HISTORY_SIZE = 20; class Cmd { diff --git a/cmd/dashboard/command_history.js b/cmd/dashboard/command_history.js index 962fdeda6..99a249471 100644 --- a/cmd/dashboard/command_history.js +++ b/cmd/dashboard/command_history.js @@ -2,8 +2,7 @@ let fs = require('../../lib/core/fs'); class CommandHistory { constructor(options = {}) { - this.cmdHistoryFile = options.cmdHistoryFile - || process.env.DEFAULT_CMD_HISTORY_PATH; + this.cmdHistoryFile = options.cmdHistoryFile || fs.dappPath('.embark', 'cmd_history'); this.history = []; this.pointer = -1; this.loadHistory(); diff --git a/lib/modules/console/index.js b/lib/modules/console/index.js index db2bc0d11..23a59f075 100644 --- a/lib/modules/console/index.js +++ b/lib/modules/console/index.js @@ -16,7 +16,7 @@ class Console { this.ipc = options.ipc; this.config = options.config; this.history = []; - this.cmdHistoryFile = options.cmdHistoryFile || process.env.DEFAULT_CMD_HISTORY_PATH; + this.cmdHistoryFile = options.cmdHistoryFile || fs.dappPath('.embark', 'cmd_history'); this.loadHistory(); if (this.ipc.isServer()) {