@volcengine-tls/volclog-human 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/run.js +9 -2
  2. package/package.json +1 -1
package/lib/run.js CHANGED
@@ -15,7 +15,8 @@ function resolveBinaryPath(options = {}) {
15
15
 
16
16
  function runCLI(options = {}) {
17
17
  const argv = options.argv || process.argv.slice(2);
18
- const binaryPath = resolveBinaryPath(options);
18
+ const packageRoot = options.packageRoot || path.resolve(__dirname, '..');
19
+ const binaryPath = resolveBinaryPath({ ...options, packageRoot });
19
20
  const spawnImpl = options.spawnImpl || spawnSync;
20
21
  const existsImpl = options.existsImpl || fs.existsSync;
21
22
  if (!existsImpl(binaryPath)) {
@@ -23,7 +24,13 @@ function runCLI(options = {}) {
23
24
  `volclog-human binary not found: ${binaryPath}. Reinstall package or run npm rebuild @volcengine-tls/volclog-human.`,
24
25
  );
25
26
  }
26
- const result = spawnImpl(binaryPath, argv, { stdio: 'inherit' });
27
+ const env = {
28
+ ...(options.env || process.env),
29
+ VOLCLOG_INSTALL_METHOD: 'npm',
30
+ VOLCLOG_NPM_PACKAGE: '@volcengine-tls/volclog-human',
31
+ VOLCLOG_NPM_PACKAGE_ROOT: packageRoot,
32
+ };
33
+ const result = spawnImpl(binaryPath, argv, { stdio: 'inherit', env });
27
34
  if (result.error) {
28
35
  throw result.error;
29
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine-tls/volclog-human",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "Volcengine TLS CLI human edition",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {