Files: efcf9fd06b02fa9bcd28681b4c777224e19702bb / test / test-79-npm / node-notifier / node-notifier.js
692 bytesRaw
1 | ; |
2 | |
3 | var fs = require('fs'); |
4 | var path = require('path'); |
5 | var notifier = require('node-notifier'); |
6 | var utils = require('node-notifier/lib/utils.js'); |
7 | var whichArgument; |
8 | |
9 | utils.command = utils.fileCommandJson = utils.immediateFileCommand = function (filename) { |
10 | var forLinux = filename === whichArgument; // 'notify-send' is built-in on linux |
11 | var forNonLinux = (fs.existsSync(filename) && path.isAbsolute(filename)); |
12 | if ((forLinux || forNonLinux) && |
13 | filename.indexOf('snapshot') < 0) { |
14 | console.log('ok'); |
15 | } |
16 | process.exit(); |
17 | }; |
18 | |
19 | var which = require('which'); |
20 | which.sync = function (filename) { |
21 | whichArgument = filename; |
22 | return true; |
23 | }; |
24 | |
25 | notifier.notify('hi!'); |
26 |
Built with git-ssb-web