Permalink
Browse files

Merge pull request #13 from perfusorius/master

Hi. I have updated growl.js to support Windows.
  • Loading branch information...
2 parents 70f06d7 + b136919 commit ff6f324838d49a7b1a34e7dcc79a6cc48a9f3daf @tj committed Feb 3, 2012
Showing with 30 additions and 1 deletion.
  1. +30 −1 lib/growl.js
View
@@ -39,6 +39,7 @@ switch(os.type()) {
, pkg: "notify-send"
, msg: ''
, sticky: '-t 0'
+ , icon: '-i'
, priority: {
cmd: '-u'
, range: [
@@ -48,6 +49,27 @@ switch(os.type()) {
]
}
};
+ break;
+ case 'Windows_NT':
+ cmd = {
+ type: "Windows"
+ , pkg: "growlnotify"
+ , msg: ''
+ , sticky: '/s:true'
+ , title: '/t:'
+ , icon: '/i:'
+ , priority: {
+ cmd: '/p:'
+ , range: [
+ -2
+ , -1
+ , 0
+ , 1
+ , 2
+ ]
+ }
+ };
+ break;
}
/**
@@ -115,7 +137,10 @@ function growl(msg, options, fn) {
args.push('--' + flag, image)
break;
case 'Linux':
- args.push('-i ' + image);
+ args.push(cmd.icon + image);
+ break;
+ case 'Windows':
+ args.push(cmd.icon + '"' + image.replace(/\\/g, "\\\\") + '"');
break;
}
}
@@ -152,6 +177,10 @@ function growl(msg, options, fn) {
args.push("'" + msg + "'");
}
break;
+ case 'Windows':
+ args.push('"' + msg + '"');
+ if (options.title) args.push(cmd.title + '"' + options.title + '"');
+ break;
}
// execute

1 comment on commit ff6f324

Contributor

perfusorius commented on ff6f324 Feb 3, 2012

The Readme.md should get updated too. Basically the info I provided in the commit message.
Are you going to update it or do you want a pull request?

Please sign in to comment.