Permalink
Browse files

ability to execute javascript files on system using new command

  • Loading branch information...
1 parent 93bfe3c commit 8179210d0281813a84b2233544d1bb689fe0fad7 @crcn crcn committed Nov 24, 2011
Showing with 58 additions and 2 deletions.
  1. +1 −1 bin/cupboard
  2. +41 −0 lib/beans/cbd.command.execute/index.js
  3. +16 −1 project.sublime-project
View
2 bin/cupboard
@@ -1,4 +1,4 @@
-#!/usr/bin/env node
+#!/usr/bin/env /usr/local/bin/node
var args = process.argv.concat().splice(2),
View
41 lib/beans/cbd.command.execute/index.js
@@ -0,0 +1,41 @@
+exports.plugin = function(router) {
+
+ router.on({
+
+ /**
+ */
+
+ 'pull -multi project/command': function() {
+
+ return {
+ name: 'execute',
+ execute: function(data, callback) {
+
+ var proj = this,
+ script = data.args.shift().replace('~', process.env.HOME);
+
+ //execute the script
+ require(script).execute.call(proj, data, callback);
+ }
+ };
+ },
+
+ /**
+ */
+
+
+
+ 'pull -multi help/item': function() {
+
+ return {
+ commands: [{
+ command: 'execute <proj> <script.js>',
+ desc: 'executes a script against project'
+ }],
+ examples: [{
+ command: 'execute my-proj change-git.js'
+ }]
+ };
+ }
+ });
+}
View
17 project.sublime-project
@@ -2,7 +2,22 @@
"folders":
[
{
- "path": "/Users/craig/.cupboard/projects/cupboard"
+ "path": "."
+ }
+ ],
+ "build_systems":
+ [
+ {
+ "name":"cbd make",
+ "cmd":["cbd","make","cupboard"]
+ },
+ {
+ "name":"cbd start",
+ "cmd":["cbd","start","cupboard"]
+ },
+ {
+ "name":"cbd make+start",
+ "cmd":["cbd","make+start","cupboard"]
}
]
}

0 comments on commit 8179210

Please sign in to comment.