Comparing version 3.8.4 to 3.8.5
@@ -5,2 +5,3 @@ var Bluebird = require('bluebird'); | ||
var access = Bluebird.promisify(require('fs').access); | ||
var readFileSync = require('fs').readFileSync; | ||
var F_OK = require('fs').F_OK | ||
@@ -38,3 +39,3 @@ var memoize = require('lodash').memoize; | ||
} | ||
return '-Epath.conf' | ||
@@ -46,2 +47,4 @@ } | ||
var cmd = join(path, 'bin', 'elasticsearch'); | ||
var scriptText = readFileSync(cmd, 'utf8'); | ||
return exec(cmd + ' -h') | ||
@@ -52,6 +55,11 @@ .then(function (results) { | ||
var confDirEnvVar = /\bCONF_DIR\b/.test(scriptText) | ||
? 'CONF_DIR' | ||
: null; | ||
return { | ||
versionFlag: getVersionFlag(stdout, stderr), | ||
configVarFlag: getConfigVarFlag(stdout, stderr), | ||
pathConfigFlag: getPathConfigFlag(stdout, stderr), | ||
confDirEnvVar: confDirEnvVar, | ||
pathConfigFlag: confDirEnvVar ? getPathConfigFlag(stdout, stderr) : null, | ||
}; | ||
@@ -58,0 +66,0 @@ }); |
@@ -54,4 +54,11 @@ var child_process = require('child_process'); | ||
self.configPath = configPath; | ||
var args = [features.pathConfigFlag + '='+ configPath]; | ||
var env = Object.assign({}, process.env); | ||
var args = []; | ||
if (features.confDirEnvVar) { | ||
env[features.confDirEnvVar] = configPath | ||
} else { | ||
args.push(features.pathConfigFlag + '='+ configPath) | ||
} | ||
// branch names aren't valid semver, just check the first number | ||
@@ -72,3 +79,5 @@ var majorVersion = version.split('.').shift(); | ||
// run the process | ||
self.process = spawn(path, args); | ||
self.process = spawn(path, args, { | ||
env: env, | ||
}); | ||
@@ -75,0 +84,0 @@ self.process.stdout |
{ | ||
"name": "libesvm", | ||
"version": "3.8.4", | ||
"version": "3.8.5", | ||
"description": "libesvm is a library for managning an Elasticsearch process for development and testing.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
999333
54
2222
21