Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove existsSync dependency

  • Loading branch information...
commit 9616139bd13d839b114a085909bd0a4e0fead5e5 1 parent 7da5917
@drudge drudge authored
Showing with 13 additions and 6 deletions.
  1. +12 −2 lib/growl.js
  2. +1 −4 package.json
View
14 lib/growl.js
@@ -5,14 +5,24 @@
*/
var exec = require('child_process').exec
- , execSync = require('execSync')
+ , exists = require('fs').existsSync
, path = require('path')
, os = require('os')
, cmd;
+function which(name) {
+ var paths = process.env.PATH.split(':');
+ var loc;
+
+ for (var i = 0, len = paths.length; i < len; ++i) {
+ loc = path.join(paths[i], name);
+ if (exists(loc)) return loc;
+ }
+}
+
switch(os.type()) {
case 'Darwin':
- if (execSync.stdout('which terminal-notifier')) {
+ if (which('terminal-notifier')) {
cmd = {
type: "Darwin-NotificationCenter"
, pkg: "terminal-notifier"
View
5 package.json
@@ -3,8 +3,5 @@
"version": "1.5.1",
"description": "Growl unobtrusive notifications",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
- "main": "./lib/growl.js",
- "dependencies": {
- "execSync": "0.0.1"
- }
+ "main": "./lib/growl.js"
}
Please sign in to comment.
Something went wrong with that request. Please try again.