From e1ea5e39b704f00597aa220d0d968e7d2fb811ab Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Fri, 24 Feb 2012 20:10:11 -0800 Subject: [PATCH] allow spaces in directory names --- northwatcher.js | 10 ++++++---- package.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/northwatcher.js b/northwatcher.js index 2078dbc..5619c8c 100755 --- a/northwatcher.js +++ b/northwatcher.js @@ -54,10 +54,10 @@ function main() { // var m - if (m = line.match(/^([-+]{0,2})\s*(\S+)\s+(.+)$/i)) { + if (m = line.match(/^([-+]{0,2})\s*(?:"([^"]+)"|(\S+))\s+(.+)$/i)) { var trigger = m[1] || '+-' // default watches for both - , dir = m[2] - , command = m[3] + , dir = m[2] || m[3] + , command = m[4] , options = { create: trigger.indexOf('+') !== -1 , remove: trigger.indexOf('-') !== -1 , command: command @@ -181,7 +181,9 @@ function spiel() { , " - todo update-remote-todo-list.sh" , "" , "So each line has an optional trigger followed by a directory and" - , "then a command. The triggers are:" + , "then a command. The directory can be quoted if it contains spaces." + , "" + , "The triggers are:" , "" , " + files are created" , " - files are removed" diff --git a/package.json b/package.json index 432beb9..a39619a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "northwatcher", "description": "NorthWatcher is cron for filesystem changes.", - "version": "0.1.9", + "version": "0.2", "homepage": "http://samhuri.net/proj/NorthWatcher", "author": "Sami Samhuri ", "repository": {