Defaults dont belong in environment variables

This commit is contained in:
Andre Medeiros 2018-10-29 19:13:04 +01:00
parent 6494bfb858
commit 31deca4729
3 changed files with 2 additions and 4 deletions

View File

@ -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 {

View File

@ -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();

View File

@ -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()) {