Download pool/shard004/JavaScript/0025189_terminal-notifier.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard004/JavaScript/0025189_terminal-notifier.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard004/JavaScript/0025189_terminal-notifier.js
-
curl -L -o 0025189_terminal-notifier.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard004/JavaScript/0025189_terminal-notifier.js
1.32 kB
| /** | |
| * A Node.js wrapper for terminal-notify. | |
| * | |
| * Requirements: | |
| * - Mac OS X 10.8 | |
| */ | |
| var path = require('path'), | |
| notifier = path.resolve(__dirname, '../../vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier'), | |
| utils = require('../utils'), | |
| Growl = require('./growl'); | |
| var fallbackNotifier = null; | |
| var Notifier = function (options) { | |
| if (!(this instanceof Notifier)) { | |
| return new Notifier(); | |
| } | |
| this.options = options; | |
| this.isOSX = false; | |
| fallbackNotifier = null; | |
| }; | |
| Notifier.prototype.notify = function (options, callback) { | |
| options = utils.mapToMac(options); | |
| var argsList = utils.constructArgumentList(options); | |
| callback = callback || function (err, data) {}; | |
| if(this.isOSX) { | |
| utils.command(notifier, argsList, callback); | |
| return this; | |
| } | |
| if(fallbackNotifier) { | |
| fallbackNotifier.notify(options, callback); | |
| return this; | |
| } | |
| var self = this; | |
| utils.isMacOSX(function (error, errorMsg) { | |
| if (error && error !== 'old') { | |
| return callback(new Error(errorMsg)); | |
| } | |
| if (error && error === 'old') { | |
| fallbackNotifier = new Growl(self.options); | |
| return fallbackNotifier.notify(options, callback); | |
| } | |
| utils.command(notifier, argsList, callback); | |
| self.isOSX = true; | |
| }); | |
| return this; | |
| }; | |
| module.exports = Notifier; | |