Skip to content

Commit

Permalink
Improved help messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard Kyvenko committed Sep 10, 2016
1 parent 2391f0f commit c1795fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions bin/create-elm-app-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
const path = require('path');
const spawn = require('cross-spawn');
const argv = require('minimist')(process.argv.slice(2));
const version = require('../package.json').version;
const elmPlatformVersion = require('../node_modules/elm/package.json').version;
const commands = argv._;

if (commands.length === 0) {
console.log('\nUsage: create-elm-app <project-directory>\n');
console.log('where <project-directory> is the name of the directory with your future project');
console.log('\nElm Platform ' + elmPlatformVersion + '\n');
console.log('create-elm-app@' + version + ' ' + path.resolve(__dirname, '..'));
process.exit(1);
}

Expand Down
4 changes: 3 additions & 1 deletion bin/global-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ const commands = argv._;
const spawn = require('cross-spawn');
const executablePaths = require('elm/platform').executablePaths;
const version = require('../package.json').version;
const elmPlatformVersion = require('../node_modules/elm/package.json').version;
const paths = require('../config/paths');

function help (version) {
console.log('\nUsage: elm-app <command>\n');
console.log('where <command> is one of:');
console.log(' create, build, start, package, reactor, make, repl\n');
console.log('elm-app@' + version + ' ' + path.resolve(__dirname, '..'));
console.log('\nElm ' + elmPlatformVersion + '\n');
console.log('create-elm-app@' + version + ' ' + path.resolve(__dirname, '..'));
}

if (commands.length === 0) {
Expand Down
5 changes: 3 additions & 2 deletions scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const WebpackDevServer = require('webpack-dev-server');
const config = require('../config/webpack.config.dev');
const opn = require('opn');

process.env.NODE_ENV = 'development';

function clear () {
console.log('\x1Bc');
}

process.env.NODE_ENV = 'development';

if (pathExists.sync('elm-package.json') === false) {
console.log('Please, run the build script from project root directory');
process.exit(0);
Expand All @@ -32,6 +32,7 @@ compiler.plugin('done', function (stats) {
let hasWarnings = stats.hasWarnings();

if (!hasErrors && !hasWarnings) {

console.log(chalk.green('Compiled successfully!'));
console.log('\nThe app is running at:');
console.log('\n ' + chalk.cyan('http://localhost:' + port + '/'));
Expand Down

0 comments on commit c1795fb

Please sign in to comment.