Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

working CLI shell

  • Loading branch information...
commit baba052da67082b40b0f0d47e25103c55251ad0e 1 parent fbafeca
@chrisfjones chrisfjones authored
View
4 .gitignore
@@ -12,3 +12,7 @@ logs
results
npm-debug.log
+
+*.iml
+.idea/
+node_modules/
View
6 bin/starman
@@ -0,0 +1,6 @@
+#!/usr/bin/env node
+var path = require('path');
+var fs = require('fs');
+var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
+
+require(lib + '/cli').run();
View
54 lib/cli.js
@@ -0,0 +1,54 @@
+// Generated by IcedCoffeeScript 1.3.3g
+(function() {
+ var colors, program, starman, todoString;
+
+ program = require('commander');
+
+ colors = require('colors');
+
+ starman = require('./starman');
+
+ todoString = 'todo: '.blue;
+
+ program.version('0.0.1').option('-v, --verbose', 'be chatty.');
+
+ program.command('init').description('Set up a new project with the appropriate directory structure. Run this within your new project\'s root directory.').action(function(options) {
+ return starman.init();
+ });
+
+ program.command('build').description('Compile everything into the release directory.').action(function(options) {
+ return starman.build();
+ });
+
+ program.command('watch').description('Keep watching for changes and then compile everything into the release directory.').action(function(options) {
+ return starman.watch();
+ });
+
+ program.command('serve').description('Throw up a server on $port to serve up everything in the release directory.').option('-p, --port [port]', 'The port with which to serve upon. Default is 8080.', parseInt).on("--help", function() {
+ return console.log("" + todoString + "display help about serve?");
+ }).action(function(options) {
+ var port, portString;
+ port = options.port || 8080;
+ portString = ("" + port).green;
+ console.log("serving on " + portString);
+ return starman.serve(port);
+ });
+
+ program.command('dev').description('Throw up a server, watch for changes, and open the site in the default browser. Great for speedy development.').option('-p, --port [port]', 'The port with which to serve upon. Default is 8080.', parseInt).on("--help", function() {
+ return console.log("todo: display help about dev?");
+ }).action(function(options) {
+ var port, portString, url;
+ port = options.port || 8080;
+ portString = ("" + port).green;
+ starman.build();
+ starman.watch();
+ starman.serve(port);
+ url = "http://localhost:" + port;
+ return console.log("" + todoString + "open " + url);
+ });
+
+ module.exports.run = function() {
+ return program.parse(process.argv);
+ };
+
+}).call(this);
View
20 lib/starman.js
@@ -0,0 +1,20 @@
+// Generated by IcedCoffeeScript 1.3.3g
+(function() {
+
+ module.exports.init = function() {
+ return console.log('init');
+ };
+
+ module.exports.build = function() {
+ return console.log('build');
+ };
+
+ module.exports.watch = function() {
+ return console.log('watch');
+ };
+
+ module.exports.serve = function() {
+ return console.log('serve');
+ };
+
+}).call(this);
View
33 package.json
@@ -0,0 +1,33 @@
+{
+ "name": "starman",
+ "version": "0.0.0",
+ "description": "A simple utility to build static websites using coffeecup templates, coffeescript, and scss.",
+ "main": "lib/cli.js",
+ "scripts": {
+ "test": ""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/thebrigade/starman.git"
+ },
+ "keywords": [
+ "coffeekup",
+ "coffeecup",
+ "coffeescript",
+ "static",
+ "middleman"
+ ],
+ "dependencies": {
+ "coffee-script" : "1.4.0",
+ "coffeecup":"0.3.18",
+ "commander" : "1.1.1",
+ "connect":"2.7.0",
+ "underscore":"1.4.2",
+ "walk":"2.2.1",
+ "node-fs":"0.1.5",
+ "colors":"0.6.0-1"
+ },
+ "author": "Chris Jones <chris@thebriga.de>",
+ "license": "MIT",
+ "readmeFilename": "README.md"
+}
View
69 src/cli.iced
@@ -0,0 +1,69 @@
+program = require 'commander'
+colors = require 'colors'
+starman = require './starman'
+
+todoString = 'todo: '.blue
+
+program
+ .version('0.0.1')
+ .option('-v, --verbose', 'be chatty.')
+
+program
+ .command('init')
+ .description('Set up a new project with the appropriate directory structure. Run this within your new project\'s root directory.')
+ .action((options) ->
+ #todo: grab any options
+ starman.init()
+ )
+
+program
+ .command('build')
+ .description('Compile everything into the release directory.')
+ .action((options) ->
+ #todo: grab any options
+ starman.build()
+ )
+
+program
+ .command('watch')
+ .description('Keep watching for changes and then compile everything into the release directory.')
+ .action((options) ->
+ #todo: grab any options
+ starman.watch()
+ )
+
+program
+ .command('serve')
+ .description('Throw up a server on $port to serve up everything in the release directory.')
+ .option('-p, --port [port]', 'The port with which to serve upon. Default is 8080.', parseInt)
+ .on("--help", ->
+ console.log "#{todoString}display help about serve?"
+ ).action((options) ->
+ port = options.port or 8080
+ portString = "#{port}".green
+ console.log "serving on #{portString}"
+ starman.serve port
+ )
+
+program
+ .command('dev')
+ .description('Throw up a server, watch for changes, and open the site in the default browser. Great for speedy development.')
+ .option('-p, --port [port]', 'The port with which to serve upon. Default is 8080.', parseInt)
+ .on("--help", ->
+ console.log "todo: display help about dev?"
+ ).action((options) ->
+ port = options.port or 8080
+ portString = "#{port}".green
+
+ starman.build()
+
+ starman.watch()
+
+ starman.serve port
+
+ url = "http://localhost:#{port}"
+ console.log "#{todoString}open #{url}"
+ )
+
+module.exports.run = ->
+ program.parse process.argv
View
12 src/starman.iced
@@ -0,0 +1,12 @@
+module.exports.init = ->
+ console.log 'init'
+
+module.exports.build = ->
+ console.log 'build'
+
+module.exports.watch = ->
+ console.log 'watch'
+
+module.exports.serve = ->
+ console.log 'serve'
+
Please sign in to comment.
Something went wrong with that request. Please try again.