snyk 1.1129.0 → 1.1130.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.
@@ -149318,11 +149318,28 @@ const shescape_1 = __webpack_require__(79114);
149318
149318
  const debugLogging = debugModule('snyk-gradle-plugin');
149319
149319
  // Executes a subprocess. Resolves successfully with stdout contents if the exit code is 0.
149320
149320
  function execute(command, args, options, perLineCallback) {
149321
- const spawnOptions = { shell: true };
149322
- if (options && options.cwd) {
149321
+ const spawnOptions = {
149322
+ shell: true,
149323
+ env: { ...process.env },
149324
+ };
149325
+ if (options === null || options === void 0 ? void 0 : options.cwd) {
149323
149326
  spawnOptions.cwd = options.cwd;
149324
149327
  }
149328
+ if (options === null || options === void 0 ? void 0 : options.env) {
149329
+ spawnOptions.env = { ...process.env, ...options.env };
149330
+ }
149325
149331
  args = (0, shescape_1.quoteAll)(args, spawnOptions);
149332
+ // Before spawning an external process, we look if we need to restore the system proxy configuration,
149333
+ // which overides the cli internal proxy configuration.
149334
+ if (process.env.SNYK_SYSTEM_HTTP_PROXY !== undefined) {
149335
+ spawnOptions.env.HTTP_PROXY = process.env.SNYK_SYSTEM_HTTP_PROXY;
149336
+ }
149337
+ if (process.env.SNYK_SYSTEM_HTTPS_PROXY !== undefined) {
149338
+ spawnOptions.env.HTTPS_PROXY = process.env.SNYK_SYSTEM_HTTPS_PROXY;
149339
+ }
149340
+ if (process.env.SNYK_SYSTEM_NO_PROXY !== undefined) {
149341
+ spawnOptions.env.NO_PROXY = process.env.SNYK_SYSTEM_NO_PROXY;
149342
+ }
149326
149343
  return new Promise((resolve, reject) => {
149327
149344
  let stdout = '';
149328
149345
  let stderr = '';