diff --git a/Makefile b/Makefile index 27239ed..365e4ea 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ help: test: @make setup @make clean + @make lint @mocha --reporter spec $(MOCHAFLAGS) # Lints the code diff --git a/lib/sauce-connect-launcher.js b/lib/sauce-connect-launcher.js index 77c207c..43ec0d4 100644 --- a/lib/sauce-connect-launcher.js +++ b/lib/sauce-connect-launcher.js @@ -165,7 +165,11 @@ function run(options, callback) { // Watching file as directory watching does not work on // all File Systems http://nodejs.org/api/fs.html#fs_caveats watcher = fs.watchFile(readyfile, {persistent: false}, function () { - ready(); + fs.exists(readyfile, function (exists) { + if (exists) { + ready(); + } + }); }); watcher.on("error", callback); diff --git a/package.json b/package.json index 7138591..8ff930f 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/bermi/sauce-connect-launcher" }, "scripts": { - "test": "mocha --reporter spec" + "test": "make test" }, "dependencies": { "lodash": "~1.3.1",