1 line
35 KiB
JSON
1 line
35 KiB
JSON
{"ast":null,"code":"/*!\n * node-sass: lib/extensions.js\n */\nvar eol = require('os').EOL,\n fs = require('fs'),\n path = require('path'),\n trueCasePathSync = require('true-case-path'),\n pkg = require('../package.json'),\n defaultBinaryDir = path.join(__dirname, '..', 'vendor');\n/**\n * Get the human readable name of the Platform that is running\n *\n * @param {string} platform - An OS platform to match, or null to fallback to\n * the current process platform\n * @return {Object} The name of the platform if matched, false otherwise\n *\n * @api public\n */\n\n\nfunction getHumanPlatform(platform) {\n switch (platform || process.platform) {\n case 'darwin':\n return 'OS X';\n\n case 'freebsd':\n return 'FreeBSD';\n\n case 'linux':\n return 'Linux';\n\n case 'linux_musl':\n return 'Linux/musl';\n\n case 'win32':\n return 'Windows';\n\n default:\n return false;\n }\n}\n/**\n * Provides a more readable version of the architecture\n *\n * @param {string} arch - An instruction architecture name to match, or null to\n * lookup the current process architecture\n * @return {Object} The value of the process architecture, or false if unknown\n *\n * @api public\n */\n\n\nfunction getHumanArchitecture(arch) {\n switch (arch || process.arch) {\n case 'ia32':\n return '32-bit';\n\n case 'x86':\n return '32-bit';\n\n case 'x64':\n return '64-bit';\n\n default:\n return false;\n }\n}\n/**\n * Get the friendly name of the Node environment being run\n *\n * @param {Object} abi - A Node Application Binary Interface value, or null to\n * fallback to the current Node ABI\n * @return {Object} Returns a string name of the Node environment or false if\n * unmatched\n *\n * @api public\n */\n\n\nfunction getHumanNodeVersion(abi) {\n switch (parseInt(abi || process.versions.modules, 10)) {\n case 11:\n return 'Node 0.10.x';\n\n case 14:\n return 'Node 0.12.x';\n\n case 42:\n return 'io.js 1.x';\n\n case 43:\n return 'io.js 1.1.x';\n\n case 44:\n return 'io.js 2.x';\n\n case 45:\n return 'io.js 3.x';\n\n case 46:\n return 'Node.js 4.x';\n\n case 47:\n return 'Node.js 5.x';\n\n case 48:\n return 'Node.js 6.x';\n\n case 49:\n return 'Electron 1.3.x';\n\n case 50:\n return 'Electron 1.4.x';\n\n case 51:\n return 'Node.js 7.x';\n\n case 53:\n return 'Electron 1.6.x';\n\n case 57:\n return 'Node.js 8.x';\n\n case 59:\n return 'Node.js 9.x';\n\n case 64:\n return 'Node.js 10.x';\n\n case 67:\n return 'Node.js 11.x';\n\n case 72:\n return 'Node.js 12.x';\n\n case 79:\n return 'Node.js 13.x';\n\n case 83:\n return 'Node.js 14.x';\n\n case 88:\n return 'Node.js 15.x';\n\n case 93:\n return 'Node.js 16.x';\n\n default:\n return false;\n }\n}\n/**\n * Get a human readable description of where node-sass is running to support\n * user error reporting when something goes wrong\n *\n * @param {string} env - The name of the native bindings that is to be parsed\n * @return {string} A description of what os, architecture, and Node version\n * that is being run\n *\n * @api public\n */\n\n\nfunction getHumanEnvironment(env) {\n var binding = env.replace(/_binding\\.node$/, ''),\n parts = binding.split('-'),\n platform = getHumanPlatform(parts[0]),\n arch = getHumanArchitecture(parts[1]),\n runtime = getHumanNodeVersion(parts[2]);\n\n if (parts.length !== 3) {\n return 'Unknown environment (' + binding + ')';\n }\n\n if (!platform) {\n platform = 'Unsupported platform (' + parts[0] + ')';\n }\n\n if (!arch) {\n arch = 'Unsupported architecture (' + parts[1] + ')';\n }\n\n if (!runtime) {\n runtime = 'Unsupported runtime (' + parts[2] + ')';\n }\n\n return [platform, arch, 'with', runtime].join(' ');\n}\n/**\n * Get the value of the binaries under the default path\n *\n * @return {Array} The currently installed node-sass bindings\n *\n * @api public\n */\n\n\nfunction getInstalledBinaries() {\n return fs.readdirSync(getBinaryDir());\n}\n/**\n * Check that an environment matches the allowlisted values or the current\n * environment if no parameters are passed\n *\n * @param {string} platform - The name of the OS platform(darwin, win32, etc...)\n * @param {string} arch - The instruction set architecture of the Node environment\n * @param {string} abi - The Node Application Binary Interface\n * @return {Boolean} True, if node-sass supports the current platform, false otherwise\n *\n * @api public\n */\n\n\nfunction isSupportedEnvironment(platform, arch, abi) {\n return false !== getHumanPlatform(platform) && false !== getHumanArchitecture(arch) && false !== getHumanNodeVersion(abi);\n}\n/**\n * Get the value of a CLI argument\n *\n * @param {String} name\n * @param {Array} args\n * @api private\n */\n\n\nfunction getArgument(name, args) {\n var flags = args || process.argv.slice(2),\n index = flags.lastIndexOf(name);\n\n if (index === -1 || index + 1 >= flags.length) {\n return null;\n }\n\n return flags[index + 1];\n}\n/**\n * Get binary name.\n * If environment variable SASS_BINARY_NAME,\n * .npmrc variable sass_binary_name or\n * process argument --binary-name is provided,\n * return it as is, otherwise make default binary\n * name: {platform}-{arch}-{v8 version}.node\n *\n * @api public\n */\n\n\nfunction getBinaryName() {\n var binaryName,\n variant,\n platform = process.platform;\n\n if (getArgument('--sass-binary-name')) {\n binaryName = getArgument('--sass-binary-name');\n } else if (process.env.SASS_BINARY_NAME) {\n binaryName = process.env.SASS_BINARY_NAME;\n } else if (process.env.npm_config_sass_binary_name) {\n binaryName = process.env.npm_config_sass_binary_name;\n } else if (pkg.nodeSassConfig && pkg.nodeSassConfig.binaryName) {\n binaryName = pkg.nodeSassConfig.binaryName;\n } else {\n variant = getPlatformVariant();\n\n if (variant) {\n platform += '_' + variant;\n }\n\n binaryName = [platform, '-', process.arch, '-', process.versions.modules].join('');\n }\n\n return [binaryName, 'binding.node'].join('_');\n}\n/**\n * Determine the URL to fetch binary file from.\n * By default fetch from the node-sass distribution\n * site on GitHub.\n *\n * The default URL can be overridden using\n * the environment variable SASS_BINARY_SITE,\n * .npmrc variable sass_binary_site or\n * or a command line option --sass-binary-site:\n *\n * node scripts/install.js --sass-binary-site http://example.com/\n *\n * The URL should to the mirror of the repository\n * laid out as follows:\n *\n * SASS_BINARY_SITE/\n *\n * v3.0.0\n * v3.0.0/freebsd-x64-14_binding.node\n * ....\n * v3.0.0\n * v3.0.0/freebsd-ia32-11_binding.node\n * v3.0.0/freebsd-x64-42_binding.node\n * ... etc. for all supported versions and platforms\n *\n * @api public\n */\n\n\nfunction getBinaryUrl() {\n var site = getArgument('--sass-binary-site') || process.env.SASS_BINARY_SITE || process.env.npm_config_sass_binary_site || pkg.nodeSassConfig && pkg.nodeSassConfig.binarySite || 'https://github.com/sass/node-sass/releases/download';\n return [site, 'v' + pkg.version, getBinaryName()].join('/');\n}\n/**\n * Get binary dir.\n * If environment variable SASS_BINARY_DIR,\n * .npmrc variable sass_binary_dir or\n * process argument --sass-binary-dir is provided,\n * select it by appending binary name, otherwise\n * use default binary dir.\n * Once the primary selection is made, check if\n * callers wants to throw if file not exists before\n * returning.\n *\n * @api public\n */\n\n\nfunction getBinaryDir() {\n var binaryDir;\n\n if (getArgument('--sass-binary-dir')) {\n binaryDir = getArgument('--sass-binary-dir');\n } else if (process.env.SASS_BINARY_DIR) {\n binaryDir = process.env.SASS_BINARY_DIR;\n } else if (process.env.npm_config_sass_binary_dir) {\n binaryDir = process.env.npm_config_sass_binary_dir;\n } else if (pkg.nodeSassConfig && pkg.nodeSassConfig.binaryDir) {\n binaryDir = pkg.nodeSassConfig.binaryDir;\n } else {\n binaryDir = defaultBinaryDir;\n }\n\n return binaryDir;\n}\n/**\n * Get binary path.\n * If environment variable SASS_BINARY_PATH,\n * .npmrc variable sass_binary_path or\n * process argument --sass-binary-path is provided,\n * select it by appending binary name, otherwise\n * make default binary path using binary name.\n * Once the primary selection is made, check if\n * callers wants to throw if file not exists before\n * returning.\n *\n * @api public\n */\n\n\nfunction getBinaryPath() {\n var binaryPath;\n\n if (getArgument('--sass-binary-path')) {\n binaryPath = getArgument('--sass-binary-path');\n } else if (process.env.SASS_BINARY_PATH) {\n binaryPath = process.env.SASS_BINARY_PATH;\n } else if (process.env.npm_config_sass_binary_path) {\n binaryPath = process.env.npm_config_sass_binary_path;\n } else if (pkg.nodeSassConfig && pkg.nodeSassConfig.binaryPath) {\n binaryPath = pkg.nodeSassConfig.binaryPath;\n } else {\n binaryPath = path.join(getBinaryDir(), getBinaryName().replace(/_(?=binding\\.node)/, '/'));\n }\n\n try {\n return trueCasePathSync(binaryPath) || binaryPath;\n } catch (e) {\n return binaryPath;\n }\n}\n/**\n * An array of paths suitable for use as a local disk cache of the binding.\n *\n * @return {[]String} an array of paths\n * @api public\n */\n\n\nfunction getCachePathCandidates() {\n return [process.env.npm_config_sass_binary_cache, process.env.npm_config_cache].filter(function (_) {\n return _;\n });\n}\n/**\n * The most suitable location for caching the binding on disk.\n *\n * Given the candidates directories provided by `getCachePathCandidates()` this\n * returns the first writable directory. By treating the candidate directories\n * as a prioritised list this method is deterministic, assuming no change to the\n * local environment.\n *\n * @return {String} directory to cache binding\n * @api public\n */\n\n\nfunction getBinaryCachePath() {\n var i,\n cachePath,\n cachePathCandidates = getCachePathCandidates();\n\n for (i = 0; i < cachePathCandidates.length; i++) {\n cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);\n\n try {\n fs.mkdirSync(cachePath, {\n recursive: true\n });\n return cachePath;\n } catch (e) {// Directory is not writable, try another\n }\n }\n\n return '';\n}\n/**\n * The cached binding\n *\n * Check the candidates directories provided by `getCachePathCandidates()` for\n * the binding file, if it exists. By treating the candidate directories\n * as a prioritised list this method is deterministic, assuming no change to the\n * local environment.\n *\n * @return {String} path to cached binary\n * @api public\n */\n\n\nfunction getCachedBinary() {\n var i,\n cachePath,\n cacheBinary,\n cachePathCandidates = getCachePathCandidates(),\n binaryName = getBinaryName();\n\n for (i = 0; i < cachePathCandidates.length; i++) {\n cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);\n cacheBinary = path.join(cachePath, binaryName);\n\n if (fs.existsSync(cacheBinary)) {\n return cacheBinary;\n }\n }\n\n return '';\n}\n/**\n * Does the supplied binary path exist\n *\n * @param {String} binaryPath\n * @api public\n */\n\n\nfunction hasBinary(binaryPath) {\n return fs.existsSync(binaryPath);\n}\n/**\n * Get Sass version information\n *\n * @api public\n */\n\n\nfunction getVersionInfo(binding) {\n return [['node-sass', pkg.version, '(Wrapper)', '[JavaScript]'].join('\\t'), ['libsass ', binding.libsassVersion(), '(Sass Compiler)', '[C/C++]'].join('\\t')].join(eol);\n}\n/**\n * Gets the platform variant, currently either an empty string or 'musl' for Linux/musl platforms.\n *\n * @api public\n */\n\n\nfunction getPlatformVariant() {\n var contents = '';\n\n if (process.platform !== 'linux') {\n return '';\n }\n\n try {\n contents = fs.readFileSync(process.execPath);\n\n if (contents.indexOf('libc.musl-x86_64.so.1') !== -1) {\n return 'musl';\n }\n } catch (err) {} // eslint-disable-line no-empty\n\n\n return '';\n}\n\nmodule.exports.hasBinary = hasBinary;\nmodule.exports.getBinaryUrl = getBinaryUrl;\nmodule.exports.getBinaryName = getBinaryName;\nmodule.exports.getBinaryDir = getBinaryDir;\nmodule.exports.getBinaryPath = getBinaryPath;\nmodule.exports.getBinaryCachePath = getBinaryCachePath;\nmodule.exports.getCachedBinary = getCachedBinary;\nmodule.exports.getCachePathCandidates = getCachePathCandidates;\nmodule.exports.getVersionInfo = getVersionInfo;\nmodule.exports.getHumanEnvironment = getHumanEnvironment;\nmodule.exports.getInstalledBinaries = getInstalledBinaries;\nmodule.exports.isSupportedEnvironment = isSupportedEnvironment;","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/node-sass/lib/extensions.js"],"names":["eol","require","EOL","fs","path","trueCasePathSync","pkg","defaultBinaryDir","join","__dirname","getHumanPlatform","platform","process","getHumanArchitecture","arch","getHumanNodeVersion","abi","parseInt","versions","modules","getHumanEnvironment","env","binding","replace","parts","split","runtime","length","getInstalledBinaries","readdirSync","getBinaryDir","isSupportedEnvironment","getArgument","name","args","flags","argv","slice","index","lastIndexOf","getBinaryName","binaryName","variant","SASS_BINARY_NAME","npm_config_sass_binary_name","nodeSassConfig","getPlatformVariant","getBinaryUrl","site","SASS_BINARY_SITE","npm_config_sass_binary_site","binarySite","version","binaryDir","SASS_BINARY_DIR","npm_config_sass_binary_dir","getBinaryPath","binaryPath","SASS_BINARY_PATH","npm_config_sass_binary_path","e","getCachePathCandidates","npm_config_sass_binary_cache","npm_config_cache","filter","_","getBinaryCachePath","i","cachePath","cachePathCandidates","mkdirSync","recursive","getCachedBinary","cacheBinary","existsSync","hasBinary","getVersionInfo","libsassVersion","contents","readFileSync","execPath","indexOf","err","module","exports"],"mappings":"AAAA;AACA;AACA;AAEA,IAAIA,GAAG,GAAGC,OAAO,CAAC,IAAD,CAAP,CAAcC,GAAxB;AAAA,IACEC,EAAE,GAAGF,OAAO,CAAC,IAAD,CADd;AAAA,IAEEG,IAAI,GAAGH,OAAO,CAAC,MAAD,CAFhB;AAAA,IAGEI,gBAAgB,GAAGJ,OAAO,CAAC,gBAAD,CAH5B;AAAA,IAIEK,GAAG,GAAGL,OAAO,CAAC,iBAAD,CAJf;AAAA,IAKEM,gBAAgB,GAAGH,IAAI,CAACI,IAAL,CAAUC,SAAV,EAAqB,IAArB,EAA2B,QAA3B,CALrB;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,gBAAT,CAA0BC,QAA1B,EAAoC;AAClC,UAAQA,QAAQ,IAAIC,OAAO,CAACD,QAA5B;AACE,SAAK,QAAL;AAAe,aAAO,MAAP;;AACf,SAAK,SAAL;AAAgB,aAAO,SAAP;;AAChB,SAAK,OAAL;AAAc,aAAO,OAAP;;AACd,SAAK,YAAL;AAAmB,aAAO,YAAP;;AACnB,SAAK,OAAL;AAAc,aAAO,SAAP;;AACd;AAAS,aAAO,KAAP;AANX;AAQD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,oBAAT,CAA8BC,IAA9B,EAAoC;AAClC,UAAQA,IAAI,IAAIF,OAAO,CAACE,IAAxB;AACE,SAAK,MAAL;AAAa,aAAO,QAAP;;AACb,SAAK,KAAL;AAAY,aAAO,QAAP;;AACZ,SAAK,KAAL;AAAY,aAAO,QAAP;;AACZ;AAAS,aAAO,KAAP;AAJX;AAMD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,mBAAT,CAA6BC,GAA7B,EAAkC;AAChC,UAAQC,QAAQ,CAACD,GAAG,IAAIJ,OAAO,CAACM,QAAR,CAAiBC,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+BA,aAA/B;AACA2B,MAAM,CAACC,OAAP,CAAelB,kBAAf,GAAoCA,kBAApC;AACAiB,MAAM,CAACC,OAAP,CAAeZ,eAAf,GAAiCA,eAAjC;AACAW,MAAM,CAACC,OAAP,CAAevB,sBAAf,GAAwCA,sBAAxC;AACAsB,MAAM,CAACC,OAAP,CAAeR,cAAf,GAAgCA,cAAhC;AACAO,MAAM,CAACC,OAAP,CAAehE,mBAAf,GAAqCA,mBAArC;AACA+D,MAAM,CAACC,OAAP,CAAexD,oBAAf,GAAsCA,oBAAtC;AACAuD,MAAM,CAACC,OAAP,CAAerD,sBAAf,GAAwCA,sBAAxC","sourcesContent":["/*!\n * node-sass: lib/extensions.js\n */\n\nvar eol = require('os').EOL,\n fs = require('fs'),\n path = require('path'),\n trueCasePathSync = require('true-case-path'),\n pkg = require('../package.json'),\n defaultBinaryDir = path.join(__dirname, '..', 'vendor');\n\n/**\n * Get the human readable name of the Platform that is running\n *\n * @param {string} platform - An OS platform to match, or null to fallback to\n * the current process platform\n * @return {Object} The name of the platform if matched, false otherwise\n *\n * @api public\n */\nfunction getHumanPlatform(platform) {\n switch (platform || process.platform) {\n case 'darwin': return 'OS X';\n case 'freebsd': return 'FreeBSD';\n case 'linux': return 'Linux';\n case 'linux_musl': return 'Linux/musl';\n case 'win32': return 'Windows';\n default: return false;\n }\n}\n\n/**\n * Provides a more readable version of the architecture\n *\n * @param {string} arch - An instruction architecture name to match, or null to\n * lookup the current process architecture\n * @return {Object} The value of the process architecture, or false if unknown\n *\n * @api public\n */\nfunction getHumanArchitecture(arch) {\n switch (arch || process.arch) {\n case 'ia32': return '32-bit';\n case 'x86': return '32-bit';\n case 'x64': return '64-bit';\n default: return false;\n }\n}\n\n/**\n * Get the friendly name of the Node environment being run\n *\n * @param {Object} abi - A Node Application Binary Interface value, or null to\n * fallback to the current Node ABI\n * @return {Object} Returns a string name of the Node environment or false if\n * unmatched\n *\n * @api public\n */\nfunction getHumanNodeVersion(abi) {\n switch (parseInt(abi || process.versions.modules, 10)) {\n case 11: return 'Node 0.10.x';\n case 14: return 'Node 0.12.x';\n case 42: return 'io.js 1.x';\n case 43: return 'io.js 1.1.x';\n case 44: return 'io.js 2.x';\n case 45: return 'io.js 3.x';\n case 46: return 'Node.js 4.x';\n case 47: return 'Node.js 5.x';\n case 48: return 'Node.js 6.x';\n case 49: return 'Electron 1.3.x';\n case 50: return 'Electron 1.4.x';\n case 51: return 'Node.js 7.x';\n case 53: return 'Electron 1.6.x';\n case 57: return 'Node.js 8.x';\n case 59: return 'Node.js 9.x';\n case 64: return 'Node.js 10.x';\n case 67: return 'Node.js 11.x';\n case 72: return 'Node.js 12.x';\n case 79: return 'Node.js 13.x';\n case 83: return 'Node.js 14.x';\n case 88: return 'Node.js 15.x';\n case 93: return 'Node.js 16.x';\n default: return false;\n }\n}\n\n/**\n * Get a human readable description of where node-sass is running to support\n * user error reporting when something goes wrong\n *\n * @param {string} env - The name of the native bindings that is to be parsed\n * @return {string} A description of what os, architecture, and Node version\n * that is being run\n *\n * @api public\n */\nfunction getHumanEnvironment(env) {\n var binding = env.replace(/_binding\\.node$/, ''),\n parts = binding.split('-'),\n platform = getHumanPlatform(parts[0]),\n arch = getHumanArchitecture(parts[1]),\n runtime = getHumanNodeVersion(parts[2]);\n\n if (parts.length !== 3) {\n return 'Unknown environment (' + binding + ')';\n }\n\n if (!platform) {\n platform = 'Unsupported platform (' + parts[0] + ')';\n }\n\n if (!arch) {\n arch = 'Unsupported architecture (' + parts[1] + ')';\n }\n\n if (!runtime) {\n runtime = 'Unsupported runtime (' + parts[2] + ')';\n }\n\n return [\n platform, arch, 'with', runtime,\n ].join(' ');\n}\n\n/**\n * Get the value of the binaries under the default path\n *\n * @return {Array} The currently installed node-sass bindings\n *\n * @api public\n */\nfunction getInstalledBinaries() {\n return fs.readdirSync(getBinaryDir());\n}\n\n/**\n * Check that an environment matches the allowlisted values or the current\n * environment if no parameters are passed\n *\n * @param {string} platform - The name of the OS platform(darwin, win32, etc...)\n * @param {string} arch - The instruction set architecture of the Node environment\n * @param {string} abi - The Node Application Binary Interface\n * @return {Boolean} True, if node-sass supports the current platform, false otherwise\n *\n * @api public\n */\nfunction isSupportedEnvironment(platform, arch, abi) {\n return (\n false !== getHumanPlatform(platform) &&\n false !== getHumanArchitecture(arch) &&\n false !== getHumanNodeVersion(abi)\n );\n}\n\n/**\n * Get the value of a CLI argument\n *\n * @param {String} name\n * @param {Array} args\n * @api private\n */\n\nfunction getArgument(name, args) {\n var flags = args || process.argv.slice(2),\n index = flags.lastIndexOf(name);\n\n if (index === -1 || index + 1 >= flags.length) {\n return null;\n }\n\n return flags[index + 1];\n}\n\n/**\n * Get binary name.\n * If environment variable SASS_BINARY_NAME,\n * .npmrc variable sass_binary_name or\n * process argument --binary-name is provided,\n * return it as is, otherwise make default binary\n * name: {platform}-{arch}-{v8 version}.node\n *\n * @api public\n */\n\nfunction getBinaryName() {\n var binaryName,\n variant,\n platform = process.platform;\n\n if (getArgument('--sass-binary-name')) {\n binaryName = getArgument('--sass-binary-name');\n } else if (process.env.SASS_BINARY_NAME) {\n binaryName = process.env.SASS_BINARY_NAME;\n } else if (process.env.npm_config_sass_binary_name) {\n binaryName = process.env.npm_config_sass_binary_name;\n } else if (pkg.nodeSassConfig && pkg.nodeSassConfig.binaryName) {\n binaryName = pkg.nodeSassConfig.binaryName;\n } else {\n variant = getPlatformVariant();\n if (variant) {\n platform += '_' + variant;\n }\n\n binaryName = [\n platform, '-',\n process.arch, '-',\n process.versions.modules\n ].join('');\n }\n\n return [binaryName, 'binding.node'].join('_');\n}\n\n/**\n * Determine the URL to fetch binary file from.\n * By default fetch from the node-sass distribution\n * site on GitHub.\n *\n * The default URL can be overridden using\n * the environment variable SASS_BINARY_SITE,\n * .npmrc variable sass_binary_site or\n * or a command line option --sass-binary-site:\n *\n * node scripts/install.js --sass-binary-site http://example.com/\n *\n * The URL should to the mirror of the repository\n * laid out as follows:\n *\n * SASS_BINARY_SITE/\n *\n * v3.0.0\n * v3.0.0/freebsd-x64-14_binding.node\n * ....\n * v3.0.0\n * v3.0.0/freebsd-ia32-11_binding.node\n * v3.0.0/freebsd-x64-42_binding.node\n * ... etc. for all supported versions and platforms\n *\n * @api public\n */\n\nfunction getBinaryUrl() {\n var site = getArgument('--sass-binary-site') ||\n process.env.SASS_BINARY_SITE ||\n process.env.npm_config_sass_binary_site ||\n (pkg.nodeSassConfig && pkg.nodeSassConfig.binarySite) ||\n 'https://github.com/sass/node-sass/releases/download';\n\n return [site, 'v' + pkg.version, getBinaryName()].join('/');\n}\n\n/**\n * Get binary dir.\n * If environment variable SASS_BINARY_DIR,\n * .npmrc variable sass_binary_dir or\n * process argument --sass-binary-dir is provided,\n * select it by appending binary name, otherwise\n * use default binary dir.\n * Once the primary selection is made, check if\n * callers wants to throw if file not exists before\n * returning.\n *\n * @api public\n */\n\nfunction getBinaryDir() {\n var binaryDir;\n\n if (getArgument('--sass-binary-dir')) {\n binaryDir = getArgument('--sass-binary-dir');\n } else if (process.env.SASS_BINARY_DIR) {\n binaryDir = process.env.SASS_BINARY_DIR;\n } else if (process.env.npm_config_sass_binary_dir) {\n binaryDir = process.env.npm_config_sass_binary_dir;\n } else if (pkg.nodeSassConfig && pkg.nodeSassConfig.binaryDir) {\n binaryDir = pkg.nodeSassConfig.binaryDir;\n } else {\n binaryDir = defaultBinaryDir;\n }\n\n return binaryDir;\n}\n\n/**\n * Get binary path.\n * If environment variable SASS_BINARY_PATH,\n * .npmrc variable sass_binary_path or\n * process argument --sass-binary-path is provided,\n * select it by appending binary name, otherwise\n * make default binary path using binary name.\n * Once the primary selection is made, check if\n * callers wants to throw if file not exists before\n * returning.\n *\n * @api public\n */\n\nfunction getBinaryPath() {\n var binaryPath;\n\n if (getArgument('--sass-binary-path')) {\n binaryPath = getArgument('--sass-binary-path');\n } else if (process.env.SASS_BINARY_PATH) {\n binaryPath = process.env.SASS_BINARY_PATH;\n } else if (process.env.npm_config_sass_binary_path) {\n binaryPath = process.env.npm_config_sass_binary_path;\n } else if (pkg.nodeSassConfig && pkg.nodeSassConfig.binaryPath) {\n binaryPath = pkg.nodeSassConfig.binaryPath;\n } else {\n binaryPath = path.join(getBinaryDir(), getBinaryName().replace(/_(?=binding\\.node)/, '/'));\n }\n\n try {\n return trueCasePathSync(binaryPath) || binaryPath;\n } catch (e) {\n return binaryPath;\n }\n}\n\n/**\n * An array of paths suitable for use as a local disk cache of the binding.\n *\n * @return {[]String} an array of paths\n * @api public\n */\nfunction getCachePathCandidates() {\n return [\n process.env.npm_config_sass_binary_cache,\n process.env.npm_config_cache,\n ].filter(function(_) { return _; });\n}\n\n/**\n * The most suitable location for caching the binding on disk.\n *\n * Given the candidates directories provided by `getCachePathCandidates()` this\n * returns the first writable directory. By treating the candidate directories\n * as a prioritised list this method is deterministic, assuming no change to the\n * local environment.\n *\n * @return {String} directory to cache binding\n * @api public\n */\nfunction getBinaryCachePath() {\n var i,\n cachePath,\n cachePathCandidates = getCachePathCandidates();\n\n for (i = 0; i < cachePathCandidates.length; i++) {\n cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);\n\n try {\n fs.mkdirSync(cachePath, {recursive: true});\n return cachePath;\n } catch (e) {\n // Directory is not writable, try another\n }\n }\n\n return '';\n}\n\n/**\n * The cached binding\n *\n * Check the candidates directories provided by `getCachePathCandidates()` for\n * the binding file, if it exists. By treating the candidate directories\n * as a prioritised list this method is deterministic, assuming no change to the\n * local environment.\n *\n * @return {String} path to cached binary\n * @api public\n */\nfunction getCachedBinary() {\n var i,\n cachePath,\n cacheBinary,\n cachePathCandidates = getCachePathCandidates(),\n binaryName = getBinaryName();\n\n for (i = 0; i < cachePathCandidates.length; i++) {\n cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);\n cacheBinary = path.join(cachePath, binaryName);\n\n if (fs.existsSync(cacheBinary)) {\n return cacheBinary;\n }\n }\n\n return '';\n}\n\n/**\n * Does the supplied binary path exist\n *\n * @param {String} binaryPath\n * @api public\n */\n\nfunction hasBinary(binaryPath) {\n return fs.existsSync(binaryPath);\n}\n\n/**\n * Get Sass version information\n *\n * @api public\n */\n\nfunction getVersionInfo(binding) {\n return [\n ['node-sass', pkg.version, '(Wrapper)', '[JavaScript]'].join('\\t'),\n ['libsass ', binding.libsassVersion(), '(Sass Compiler)', '[C/C++]'].join('\\t'),\n ].join(eol);\n}\n\n/**\n * Gets the platform variant, currently either an empty string or 'musl' for Linux/musl platforms.\n *\n * @api public\n */\n\nfunction getPlatformVariant() {\n var contents = '';\n\n if (process.platform !== 'linux') {\n return '';\n }\n\n try {\n contents = fs.readFileSync(process.execPath);\n\n if (contents.indexOf('libc.musl-x86_64.so.1') !== -1) {\n return 'musl';\n }\n } catch (err) { } // eslint-disable-line no-empty\n\n return '';\n}\n\nmodule.exports.hasBinary = hasBinary;\nmodule.exports.getBinaryUrl = getBinaryUrl;\nmodule.exports.getBinaryName = getBinaryName;\nmodule.exports.getBinaryDir = getBinaryDir;\nmodule.exports.getBinaryPath = getBinaryPath;\nmodule.exports.getBinaryCachePath = getBinaryCachePath;\nmodule.exports.getCachedBinary = getCachedBinary;\nmodule.exports.getCachePathCandidates = getCachePathCandidates;\nmodule.exports.getVersionInfo = getVersionInfo;\nmodule.exports.getHumanEnvironment = getHumanEnvironment;\nmodule.exports.getInstalledBinaries = getInstalledBinaries;\nmodule.exports.isSupportedEnvironment = isSupportedEnvironment;\n"]},"metadata":{},"sourceType":"script"} |