Initial commit
[yaffs-website] / node_modules / node-sass / lib / errors.js
1 /*!
2  * node-sass: lib/errors.js
3  */
4
5 var sass = require('./extensions'),
6   pkg = require('../package.json');
7
8 function humanEnvironment() {
9   return sass.getHumanEnvironment(sass.getBinaryName());
10 }
11
12 function foundBinaries() {
13   return [
14     'Found bindings for the following environments:',
15     foundBinariesList(),
16   ].join('\n');
17 }
18
19 function foundBinariesList() {
20   return sass.getInstalledBinaries().map(function(env) {
21     return '  - ' + sass.getHumanEnvironment(env);
22   }).join('\n');
23 }
24
25 function missingBinaryFooter() {
26   return [
27     'This usually happens because your environment has changed since running `npm install`.',
28     'Run `npm rebuild node-sass` to build the binding for your current environment.',
29   ].join('\n');
30 }
31
32 module.exports.unsupportedEnvironment = function() {
33   return [
34     'Node Sass does not yet support your current environment: ' + humanEnvironment(),
35     'For more information on which environments are supported please see:',
36     'https://github.com/sass/node-sass/releases/tag/v' + pkg.version
37   ].join('\n');
38 };
39
40 module.exports.missingBinary = function() {
41   return [
42     'Missing binding ' + sass.getBinaryPath(),
43     'Node Sass could not find a binding for your current environment: ' + humanEnvironment(),
44     '',
45     foundBinaries(),
46     '',
47     missingBinaryFooter(),
48   ].join('\n');
49 };