Browse files

Make noflo executable run on node instead of 'coffee' command

  • Loading branch information...
1 parent c09aa44 commit f30d0facf6ce57baecd2fc0daea74b831868feb6 @bergie bergie committed Aug 24, 2011
Showing with 38 additions and 38 deletions.
  1. +1 −0 .npmignore
  2. +2 −0 Cakefile
  3. +2 −33 bin/noflo
  4. +33 −0 bin/noflo.coffee
  5. +0 −5 package.json
View
1 .npmignore
@@ -0,0 +1 @@
+.git*
View
2 Cakefile
@@ -6,6 +6,8 @@ task 'build', ->
console.log err if err
exec 'coffee -o components/HTTP -c components/HTTP/*.coffee', (err) ->
console.log err if err
+ exec 'coffee -o bin -c bin/noflo.coffee', (err) ->
+ console.log err if err
task 'test', ->
exec 'nodeunit test', (err) ->
View
35 bin/noflo
@@ -1,33 +1,2 @@
-#!/usr/bin/env coffee
-nofloRoot = "#{__dirname}/.."
-noflo = require "noflo"
-cli = require "cli"
-
-cli.enable "help"
-cli.enable "version"
-cli.enable "glob"
-cli.enable "daemon"
-cli.setApp "#{nofloRoot}/package.json"
-
-# Non-interactive processing
-cli.parse
- listen: ['l', 'Start NoFlo server on this port', 'number']
- interactive: ['i', 'Start an interactive NoFlo shell']
-
-cli.main (args, options) ->
- if options.interactive
- process.argv = [process.argv[0], process.argv[1]]
- shell = require "#{nofloRoot}/lib/shell"
-
- cli.args.shift()
- return unless cli.args.length
-
- for arg in cli.args
- if arg.indexOf(".json") is -1
- console.error "#{arg} is not a NoFlo graph file, skipping"
- continue
- noflo.loadFile "#{nofloRoot}/#{arg}", (network) ->
- return unless options.interactive
-
- shell.app.network = network
- shell.app.setPrompt network.graph.name
+#!/usr/bin/env node
+require(__dirname + "/noflo.js");
View
33 bin/noflo.coffee
@@ -0,0 +1,33 @@
+#!/usr/bin/env node
+nofloRoot = "#{__dirname}/.."
+noflo = require "noflo"
+cli = require "cli"
+
+cli.enable "help"
+cli.enable "version"
+cli.enable "glob"
+cli.enable "daemon"
+cli.setApp "#{nofloRoot}/package.json"
+
+# Non-interactive processing
+cli.parse
+ listen: ['l', 'Start NoFlo server on this port', 'number']
+ interactive: ['i', 'Start an interactive NoFlo shell']
+
+cli.main (args, options) ->
+ if options.interactive
+ process.argv = [process.argv[0], process.argv[1]]
+ shell = require "#{nofloRoot}/lib/shell"
+
+ cli.args.shift()
+ return unless cli.args.length
+
+ for arg in cli.args
+ if arg.indexOf(".json") is -1
+ console.error "#{arg} is not a NoFlo graph file, skipping"
+ continue
+ noflo.loadFile "#{nofloRoot}/#{arg}", (network) ->
+ return unless options.interactive
+
+ shell.app.network = network
+ shell.app.setPrompt network.graph.name
View
5 package.json
@@ -15,16 +15,11 @@
"node": ">=0.4.0"
},
"dependencies": {
- "coffee-script": ">=1.1.1",
"shell": ">=0.0.9",
"cli": ">=0.3.7",
"daemon": ">=0.3.0",
"glob": ">=2.0.7"
},
- "directories": {
- "lib": "./lib",
- "components": "./components"
- },
"main": "./lib/NoFlo",
"bin": {
"noflo": "./bin/noflo"

0 comments on commit f30d0fa

Please sign in to comment.