From 0dbefad48bd4882db3c810b0716ac5c26bb78fff Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 1 Jun 2018 11:57:01 -0400 Subject: [PATCH] move requires to methods that actually need them --- lib/cmd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cmd.js b/lib/cmd.js index e58b852e..77af4017 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -1,6 +1,4 @@ const program = require('commander'); -const promptly = require('promptly'); -const utils = require('./utils/utils.js'); const Embark = require('../lib/index'); const i18n = require('./i18n/i18n.js'); let embark = new Embark; @@ -50,6 +48,7 @@ class Cmd { .action(function (name, options) { i18n.setOrDetectLocale(options.locale); if (name === undefined) { + const promptly = require('promptly'); return promptly.prompt(__("Name your app (default is %s):", 'embarkDapp'), { default: "embarkDApp", validator: validateName @@ -259,6 +258,7 @@ class Cmd { program .action(function (cmd) { console.log((__('unknown command') + ' "%s"').red, cmd); + let utils = require('./utils/utils.js'); let dictionary = ['new', 'demo', 'build', 'run', 'blockchain', 'simulator', 'test', 'upload', 'version']; let suggestion = utils.proposeAlternative(cmd, dictionary); if (suggestion) {