Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit ba2aa59

Browse files
committed
update other uses of getBinaryName
1 parent 27adfc5 commit ba2aa59

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

lib/errors.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
*/
44

55
var sass = require('./extensions'),
6+
Constants = require('./constants'),
67
pkg = require('../package.json');
78

89
function humanEnvironment() {
9-
return sass.getHumanEnvironment(sass.getBinaryName());
10+
return sass.getHumanEnvironment(sass.getBinaryName(Constants.DefaultOptions));
1011
}
1112

1213
function foundBinaries() {

lib/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
var path = require('path'),
66
clonedeep = require('lodash/cloneDeep'),
7+
Constants = require('./constants'),
78
assign = require('lodash/assign'),
89
sass = require('./extensions');
910

@@ -468,7 +469,7 @@ function processSassDeprecationMessage() {
468469

469470
process.sass = process.sass || {
470471
get versionInfo() { processSassDeprecationMessage(); return module.exports.info; },
471-
get binaryName() { processSassDeprecationMessage(); return sass.getBinaryName(); },
472+
get binaryName() { processSassDeprecationMessage(); return sass.getBinaryName(Constants.DefaultOptions); },
472473
get binaryUrl() { processSassDeprecationMessage(); return sass.getBinaryUrl(); },
473474
get binaryPath() { processSassDeprecationMessage(); return sass.getBinaryPath(); },
474475
get getBinaryPath() { processSassDeprecationMessage(); return sass.getBinaryPath; },

test/binding.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
var assert = require('assert'),
44
path = require('path'),
55
etx = require('../lib/extensions'),
6+
Constants = require('../lib/constants'),
67
binding = process.env.NODESASS_COV
78
? require('../lib-cov/binding')
89
: require('../lib/binding');
@@ -33,7 +34,7 @@ describe('binding', function() {
3334

3435
if ((err instanceof Error)) {
3536
return err.message.indexOf(
36-
etx.getHumanEnvironment(etx.getBinaryName())
37+
etx.getHumanEnvironment(etx.getBinaryName(Constants.DefaultOptions))
3738
) !== -1;
3839
}
3940
}

test/runtime.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var assert = require('assert'),
2-
sass = process.env.NODESASS_COV
2+
Constants = require('../lib/constants');
3+
sass = process.env.NODESASS_COV
34
? require('../lib-cov/extensions')
45
: require('../lib/extensions');
56

@@ -26,25 +27,25 @@ describe('runtime parameters', function() {
2627
});
2728

2829
it('command line argument', function() {
29-
assert.equal(sass.getBinaryName(), 'aaa_binding.node');
30+
assert.equal(sass.getBinaryName(Constants.DefaultOptions), 'aaa_binding.node');
3031
});
3132

3233
it('environment variable', function() {
3334
process.argv = [];
34-
assert.equal(sass.getBinaryName(), 'bbb_binding.node');
35+
assert.equal(sass.getBinaryName(Constants.DefaultOptions), 'bbb_binding.node');
3536
});
3637

3738
it('npm config variable', function() {
3839
process.argv = [];
3940
process.env.SASS_BINARY_NAME = null;
40-
assert.equal(sass.getBinaryName(), 'ccc_binding.node');
41+
assert.equal(sass.getBinaryName(Constants.DefaultOptions), 'ccc_binding.node');
4142
});
4243

4344
it('package.json', function() {
4445
process.argv = [];
4546
process.env.SASS_BINARY_NAME = null;
4647
process.env.npm_config_sass_binary_name = null;
47-
assert.equal(sass.getBinaryName(), 'ddd_binding.node');
48+
assert.equal(sass.getBinaryName(Constants.DefaultOptions), 'ddd_binding.node');
4849
});
4950
});
5051

0 commit comments

Comments
 (0)