From 914428c2663b4b00d1405c11f5c0c26d4a284861 Mon Sep 17 00:00:00 2001 From: Craig Condon Date: Sun, 4 Dec 2011 16:23:18 -0600 Subject: [PATCH] added restart method --- lib/process.js | 23 +- project.sublime-workspace | 529 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 545 insertions(+), 7 deletions(-) create mode 100644 project.sublime-workspace diff --git a/lib/process.js b/lib/process.js index e1893af..ec58db0 100644 --- a/lib/process.js +++ b/lib/process.js @@ -34,7 +34,7 @@ var Process = module.exports = Structr({ for(var programName in programs) { //skip if already present - if(programName.indexOf(this.processId+'_') == 0) continue; + if(programName.indexOf(this.processId + '_') == 0) continue; var name = this.processId + '_' + programName; @@ -53,10 +53,10 @@ var Process = module.exports = Structr({ } else { - this.config.addProgram({ script: this.current.appDir, name: this.processId, environment: this.current.environment }, callback); + this.config.addProgram({ script: this.current.appDir, name: this.processId, environment: this.current.environment }); } - this.config.enable(); + this.config.enable(callback); }, /** @@ -64,7 +64,7 @@ var Process = module.exports = Structr({ 'stop': function(callback) { - this.config.disable(); + this.config.disable(callback); }, /** @@ -72,8 +72,17 @@ var Process = module.exports = Structr({ 'restart': function(callback) { - //doesn't work with multiple procs - //beet.restart(this.processId, callback); - } + + console.log("Stopping"); + var self = this; + this.stop(function() { + console.log('Stopped'); + self.start(function(err, stdout, stderr) { + console.log("Started"); + if(callback) callback(err, stdout, stderr); + }) + }) + }, + }); \ No newline at end of file diff --git a/project.sublime-workspace b/project.sublime-workspace new file mode 100644 index 0000000..e992152 --- /dev/null +++ b/project.sublime-workspace @@ -0,0 +1,529 @@ +{ + "auto_complete": + { + "selected_items": + [ + ] + }, + "buffers": + [ + { + "file": "/tmp/subl stdin v2bV0V.txt", + "settings": + { + "buffer_size": 0, + "line_ending": "Unix" + } + }, + { + "file": "lib/app.js", + "settings": + { + "buffer_size": 8075, + "line_ending": "Unix" + } + }, + { + "file": "lib/link/javascript.js", + "settings": + { + "buffer_size": 1029, + "line_ending": "Unix" + } + }, + { + "file": "lib/checkout/git.js", + "settings": + { + "buffer_size": 727, + "line_ending": "Unix" + } + }, + { + "file": "/tmp/subl stdin Lb2MSO.txt", + "settings": + { + "buffer_size": 0, + "line_ending": "Unix" + } + }, + { + "file": "lib/factory.js", + "settings": + { + "buffer_size": 478, + "line_ending": "Unix" + } + }, + { + "file": "lib/link/index.js", + "settings": + { + "buffer_size": 126, + "line_ending": "Unix" + } + }, + { + "file": "lib/checkout/index.js", + "settings": + { + "buffer_size": 131, + "line_ending": "Unix" + } + }, + { + "file": "lib/process.js", + "settings": + { + "buffer_size": 1769, + "line_ending": "Unix" + } + } + ], + "build_system": "", + "command_palette": + { + "height": 0.0, + "selected_items": + [ + ], + "width": 0.0 + }, + "console": + { + "height": 136.0 + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "file_history": + [ + "/tmp/subl stdin PpGR5x.txt", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/bonsai/lib/gardener/index.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/bonsai/bin/bonsai", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/test1/plugins/hello1.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/plugins/remote.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/queue.js", + "/tmp/subl stdin gYzqGJ.txt", + "/tmp/subl stdin ZshK9R.txt", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/dnode/server-plugins/sayHello.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/index.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/dnode/client-plugins/hello.client.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/test1/plugins/hello2.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/dnode/index.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/dnode/dnode-server.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/remote/now-client", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/remote/dnode-server.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/remote/now-client.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/remote/client.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/remote/now-server.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/dnode/server-plugins/hello.dnode.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/package.json", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/core.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/dnode/server.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/test1/index.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/plugins/hooks.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/README.md", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/loaders/now.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/loaders/hookio.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/loaders/dnode.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/loaders/beanpoll.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/lib/web.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/test2/api/users/photos/index.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/test2/index.js", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/examples/test2/api/users/index.js", + "/tmp/subl stdin 62uD9w.txt", + "/tmp/subl stdin be5qUw.txt", + "/Volumes/minimac/Users/craig/Dropbox/Developer/Public/haba/project.sublime-project", + "/Users/craigcondon/Dropbox/Developer/Public/haba/examples/test.js", + "/Users/craigcondon/Dropbox/Developer/Public/haba/examples/test1/bootstrap.js", + "/Users/craigcondon/Dropbox/Developer/Public/haba/examples/test1/plugins/hello2.js", + "/Users/craigcondon/Dropbox/Developer/Public/haba/examples/test1/plugins/hello1.js", + "/Users/craigcondon/Dropbox/Developer/Public/haba/examples/test1/index.js" + ], + "find": + { + "height": 33.0 + }, + "find_in_files": + { + "height": 0.0, + "where_history": + [ + ] + }, + "find_state": + { + "case_sensitive": false, + "find_history": + [ + "checkout", + "console.log", + ".on(", + "using ", + "status'", + "console.", + "vine", + "restart", + "nextNode", + "auth/token", + "_pass", + "auth/token", + "_gittyup", + "given ha", + "console.l", + "addMethods", + "plugins", + "require", + "start", + "basename", + "next", + "initModules", + "require", + "plugins'", + "plugins", + "call", + "fs.", + "web.js", + "fileExists", + "call", + "call(", + "conso", + "console.l", + "module", + ".module", + "modules", + "callback", + "instance", + "normalizeRequired", + "normaliz", + "normal", + "args", + "--all" + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": false, + "replace_history": + [ + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 1, + "sheets": + [ + { + "buffer": 0, + "file": "/tmp/subl stdin v2bV0V.txt", + "settings": + { + "buffer_size": 0, + "regions": + { + }, + "selection": + [ + [ + 0, + 0 + ] + ], + "settings": + { + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 1, + "file": "lib/app.js", + "settings": + { + "buffer_size": 8075, + "regions": + { + }, + "selection": + [ + [ + 6125, + 6125 + ] + ], + "settings": + { + "syntax": "Packages/JavaScript/JavaScript.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 4515.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 2, + "file": "lib/link/javascript.js", + "settings": + { + "buffer_size": 1029, + "regions": + { + }, + "selection": + [ + [ + 731, + 731 + ] + ], + "settings": + { + "syntax": "Packages/JavaScript/JavaScript.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 89.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 3, + "file": "lib/checkout/git.js", + "settings": + { + "buffer_size": 727, + "regions": + { + }, + "selection": + [ + [ + 449, + 449 + ] + ], + "settings": + { + "syntax": "Packages/JavaScript/JavaScript.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 4, + "file": "/tmp/subl stdin Lb2MSO.txt", + "settings": + { + "buffer_size": 0, + "regions": + { + }, + "selection": + [ + [ + 0, + 0 + ] + ], + "settings": + { + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 5, + "file": "lib/factory.js", + "settings": + { + "buffer_size": 478, + "regions": + { + }, + "selection": + [ + [ + 276, + 276 + ] + ], + "settings": + { + "syntax": "Packages/JavaScript/JavaScript.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 6, + "file": "lib/link/index.js", + "settings": + { + "buffer_size": 126, + "regions": + { + }, + "selection": + [ + [ + 83, + 83 + ] + ], + "settings": + { + "syntax": "Packages/JavaScript/JavaScript.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 7, + "file": "lib/checkout/index.js", + "settings": + { + "buffer_size": 131, + "regions": + { + }, + "selection": + [ + [ + 131, + 131 + ] + ], + "settings": + { + "syntax": "Packages/JavaScript/JavaScript.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "type": "text" + }, + { + "buffer": 8, + "file": "lib/process.js", + "settings": + { + "buffer_size": 1769, + "regions": + { + }, + "selection": + [ + [ + 1527, + 1527 + ] + ], + "settings": + { + "syntax": "Packages/JavaScript/JavaScript.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 0.0 + }, + "input": + { + "height": 30.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "replace": + { + "height": 0.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "selected_items": + [ + ], + "width": 0.0 + }, + "select_project": + { + "height": 0.0, + "selected_items": + [ + ], + "width": 0.0 + }, + "show_minimap": true, + "show_open_files": false, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 226.0, + "status_bar_visible": true +}