Permalink
Browse files

** Release ** ! npm install bounce

  • Loading branch information...
1 parent 831151b commit 62493efc4c4479427f08394b174a99829f481e9b Jonah Fox committed Oct 8, 2010
Showing with 22 additions and 92 deletions.
  1. +7 −11 README.md
  2. +0 −79 lib/growl.js
  3. +13 −0 package.json
  4. +1 −1 test/error.js
  5. +1 −1 test/test.js
View
@@ -15,31 +15,27 @@ All STDOUT AND STDERR should be piped back to the console, so it shouldn't look
Install
-----
-sudo bin/install
+npm install bounce
Usage
----
-bounce -w [-r] [-g] 'command_to_run -a -b arg1 arg2'
+bounce [-r] [-g] -w 'dir1,dir2' 'command_to_run -a -b arg1 arg2'
-w: watch paths, comma separated. If using globs (*) then must be wrapped in quotes, e.g. 'lib/*.*'
-r: respawn on child process exit
-g: growl notify on child process exit (needs growlnotify)
-h: show this usage
Running Tests
-----
+-----
-* bin/bounce -r -g -w "node test/test.js"
+* bin/bounce -r -g -w "*" "test/*.js,test/*/*.js" "node test/test.js"
Changes to test.js and watch/file.js should cause the counter to restart.
+ Counter should restart after 10 s (due to exception being thrown)
-* bin/bounce -w "node test/error.js"
+* bin/bounce "node test/error.js"
Should throw an error and exit immediately
-Tested on Ubuntu/OSX on Node 0.2.3
-
-Todo
-----
-
-* npm
+Tested on Ubuntu/OSX on Node 0.2.3
View
@@ -1,79 +0,0 @@
-// Growl - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
-
-/**
- * Module dependencies.
- */
-
-var child_process = require('child_process'),
- path = require('path')
-
-/**
- * Node-growl version.
- */
-
-exports.version = '1.0.2'
-
-/**
- * Fetch the binary version when available.
- *
- * @param {function} callback
- * @api public
- */
-
-exports.binVersion = function(callback) {
- child_process.exec('growlnotify -v', function(err, stdout, stderr){
- if (err) callback(err)
- else callback(null, stdout)
- })
-}
-
-/**
- * Send growl notification _msg_ with _options_.
- *
- * Options:
- *
- * - title Notification title
- * - sticky Make the notification stick (defaults to false)
- * - name Application name (defaults to growlnotify)
- * - image
- * - path to an icon sets --iconpath
- * - path to an image sets --image
- * - capitalized word sets --appIcon
- * - filename uses extname as --icon
- * - otherwise treated as --icon
- *
- * Examples:
- *
- * growl.notify('New email')
- * growl.notify('5 new emails', { title: 'Thunderbird' })
- * growl.notify('Email sent', function(){
- * // ... notification sent
- * })
- *
- * @param {string} msg
- * @param {object} options
- * @param {function} callback
- * @api public
- */
-
-exports.notify = function(msg, options, callback) {
- var image,
- args = ['growlnotify', '-m', '"' + msg + '"'],
- options = options || {}
- exports.binVersion(function(err, version){
- if (err) return callback(err)
- if (image = options.image) {
- var flag, ext = path.extname(image).substr(1)
- flag = flag || ext == 'icns' && 'iconpath'
- flag = flag || /^[A-Z]/.test(image) && 'appIcon'
- flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image'
- flag = flag || ext && (image = ext) && 'icon'
- flag = flag || 'icon'
- args.push('--' + flag, image)
- }
- if (options.sticky) args.push('--sticky')
- if (options.name) args.push('--name', options.name)
- if (options.title) args.push(options.title)
- child_process.exec(args.join(' '), callback)
- })
-}
View
@@ -0,0 +1,13 @@
+{
+ "name": "bounce",
+ "version": "0.0.1",
+ "description": "Restart scripts upon code changes",
+ "author": "weepy",
+ "bin": "./bin/bounce",
+ "repository": "http://github.com/weepy/bounce",
+ "dependencies": {
+ "glob": "*",
+ "growl": "*"
+ },
+ "engines" : [ "node >=0.2" ]
+}
View
@@ -1 +1 @@
-throw "error"
+throw "error"
View
@@ -1,6 +1,6 @@
var i = 0
-
+
function go() {
if( i < 1000) {
console.log(i)

0 comments on commit 62493ef

Please sign in to comment.