This commit is contained in:
Iuri Matias 2017-10-14 06:06:09 -04:00
parent f450bf2e6a
commit 704a1ff517
2 changed files with 6 additions and 10 deletions

View File

@ -1,8 +1,5 @@
let program = require('commander'); const program = require('commander');
let colors = require('colors'); const promptly = require('promptly');
let shelljs = require('shelljs');
let promptly = require('promptly');
let path = require('path');
const Embark = require('../lib/index'); const Embark = require('../lib/index');
let embark = new Embark; let embark = new Embark;
@ -30,11 +27,11 @@ class Cmd {
program.parse(args); program.parse(args);
} }
newApp(name) { newApp() {
let validateName = function (value) { let validateName = function (value) {
try { try {
if (value.match(/^[a-zA-Z\s\-]+$/)) return value; if (value.match(/^[a-zA-Z\s-]+$/)) return value;
} catch (e) { } catch (e) {
throw new Error('Name must be only letters, spaces, or dashes'); throw new Error('Name must be only letters, spaces, or dashes');
} }
@ -79,7 +76,7 @@ class Cmd {
program program
.command('build [environment]') .command('build [environment]')
.description('deploy and build dapp at dist/ (default: development)') .description('deploy and build dapp at dist/ (default: development)')
.action(function (env, options) { .action(function (env, _options) {
embark.build({env: env || 'development'}); embark.build({env: env || 'development'});
}); });
} }
@ -150,7 +147,7 @@ class Cmd {
program program
.command('upload [platform] [environment]') .command('upload [platform] [environment]')
.description('upload your dapp to a decentralized storage. possible options: ipfs, swarm (e.g embark upload swarm)') .description('upload your dapp to a decentralized storage. possible options: ipfs, swarm (e.g embark upload swarm)')
.action(function (platform, env, options) { .action(function (platform, env, _options) {
// TODO: get env in cmd line as well // TODO: get env in cmd line as well
embark.initConfig(env || 'development', { embark.initConfig(env || 'development', {
embarkConfig: 'embark.json', interceptLogs: false embarkConfig: 'embark.json', interceptLogs: false

View File

@ -1,4 +1,3 @@
var colors = require('colors');
var shelljs = require('shelljs'); var shelljs = require('shelljs');
var fs = require('../../core/fs.js'); var fs = require('../../core/fs.js');