Skip to content

Commit

Permalink
Fix Make Command
Browse files Browse the repository at this point in the history
  • Loading branch information
idmontie committed Jan 11, 2016
1 parent f2f5dcd commit 501835b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Space Kitty

![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)

For Node v5.4.0+.
For Meteor 1.2+ and Node v5.4.0+.

[Full documentation available on the website](http://spacekitty.capsulecat.com/).

An [opinionated](http://stackoverflow.com/questions/802050/what-is-opinionated-software) command line utility for quickly creating Meteor projects.

Expand Down Expand Up @@ -89,7 +91,7 @@ lib
## make:command

```sh
kitty make:command [Namespace] CommandName [server|client|(both)]
kitty make:command [Namespace] CommandName [--server|client|(both)]
```

This command will create a command (defaults to both a client and server):
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "space-kitty",
"version": "0.1.3",
"version": "0.1.4",
"description": "Opinionated Meteor command line utility",
"homepage": "http://spacekitty.capsulecat.com",
"bugs": "https://github.com/capsulecat/spacekitty/issues",
Expand Down
27 changes: 15 additions & 12 deletions src/commands/MakeCommandCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ var MakeUtilities = require('../utilities/MakeUtilities');

var MakeCommandCommand = function () {
var _arguments = Array.prototype.slice.call(arguments);
var _namespace = (_arguments.length > 2 ? _arguments[0] : '');
var _namespace = (_arguments.length > 1 ? _arguments[0] : '');
var _namespaceDashed = MakeUtilities.camelToDash(_namespace);
var _hasNamespace = (_arguments.length > 2);
var _name = (_arguments.length > 2 ? _arguments[1] : _arguments[0] );
var _hasNamespace = (_arguments.length > 1);
var _name = (_arguments.length > 1 ? _arguments[1] : _arguments[0] );
var _nameDashed = MakeUtilities.camelToDash(_name);
var _type = (function () {
var arg = _arguments[_arguments.length - 1];
if (['client', 'server', 'both'].indexOf(arg) !== -1) {
return arg;
} else {
return 'both';
}
})();
var _type = 'both'

var _templatePath = function() {
return path.join(__dirname, '..', '..', 'scaffolding', 'templates', 'command.js.handlebars');
Expand Down Expand Up @@ -52,7 +45,17 @@ var MakeCommandCommand = function () {
});
}

var handle = function () {
var handle = function (flags) {
_type = (function () {
if (flags.indexOf('--client') !== -1) {
return 'client';
} else if (flags.indexOf('--server') !== -1) {
return 'server';
} else {
return 'both';
}
})();

var jsContent = _templatize(_templatePath());

var workingDirectory = process.cwd();
Expand Down

0 comments on commit 501835b

Please sign in to comment.