Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2095 from trufflesuite/clean-up-develop
Browse files Browse the repository at this point in the history
Internal improvement: Clean up develop and console code
  • Loading branch information
eggplantzzz committed Jun 27, 2019
2 parents 247e2ff + a3c1e0f commit af801fd
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 262 deletions.
10 changes: 5 additions & 5 deletions packages/truffle-core/lib/commands/console.js
Expand Up @@ -29,19 +29,19 @@ const command = {
const commands = require("./index");
const excluded = ["console", "init", "watch", "develop"];

const available_commands = Object.keys(commands).filter(function(name) {
const availableCommands = Object.keys(commands).filter(name => {
return excluded.indexOf(name) === -1;
});

let console_commands = {};
available_commands.forEach(function(name) {
console_commands[name] = commands[name];
const consoleCommands = {};
availableCommands.forEach(name => {
consoleCommands[name] = commands[name];
});

Environment.detect(config)
.then(() => {
const c = new Console(
console_commands,
consoleCommands,
config.with({ noAliases: true })
);
c.start(done);
Expand Down
6 changes: 3 additions & 3 deletions packages/truffle-core/lib/commands/develop.js
Expand Up @@ -21,19 +21,19 @@ const command = {
const commands = require("./index");
const excluded = ["console", "develop", "unbox", "init"];

const available_commands = Object.keys(commands).filter(
const availableCommands = Object.keys(commands).filter(
name => !excluded.includes(name)
);

const console_commands = available_commands.reduce(
const consoleCommands = availableCommands.reduce(
(acc, name) => Object.assign({}, acc, { [name]: commands[name] }),
{}
);

Environment.develop(config, ganacheOptions)
.then(() => {
const c = new Console(
console_commands,
consoleCommands,
config.with({ noAliases: true })
);
c.start(done);
Expand Down

0 comments on commit af801fd

Please sign in to comment.