snyk 1.1052.0 → 1.1054.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.
package/dist/cli/263.index.js
CHANGED
|
@@ -140362,7 +140362,12 @@ async function pullWithDockerBinary(docker, targetImage, saveLocation, username,
|
|
|
140362
140362
|
err.stderr.includes("operating system is not supported")) {
|
|
140363
140363
|
throw new Error(`Operating system is not supported`);
|
|
140364
140364
|
}
|
|
140365
|
-
|
|
140365
|
+
const unknownManifestConditions = [
|
|
140366
|
+
"no matching manifest for",
|
|
140367
|
+
"manifest unknown",
|
|
140368
|
+
];
|
|
140369
|
+
if (err.stderr &&
|
|
140370
|
+
unknownManifestConditions.some((value) => err.stderr.includes(value))) {
|
|
140366
140371
|
if (platform) {
|
|
140367
140372
|
throw new Error(`The image does not exist for ${platform}`);
|
|
140368
140373
|
}
|
|
@@ -142709,8 +142714,17 @@ function extractModuleInformation(binary) {
|
|
|
142709
142714
|
if (!mod) {
|
|
142710
142715
|
throw Error("binary contains empty module info");
|
|
142711
142716
|
}
|
|
142712
|
-
const [, mainModuleLine, ...versionsLines] = mod.split("\n");
|
|
142713
|
-
const
|
|
142717
|
+
const [pathDirective, mainModuleLine, ...versionsLines] = mod.split("\n");
|
|
142718
|
+
const lineSplit = mainModuleLine.split("\t");
|
|
142719
|
+
let name = lineSplit[1];
|
|
142720
|
+
if (lineSplit[0] !== "mod") {
|
|
142721
|
+
// If the binary has no mod directive, it is a binary from the Go
|
|
142722
|
+
// distribution, like the "go" command, "vet", "gofmt" or others. In that
|
|
142723
|
+
// case, we use "go-distribution@" plus the path directive ("cmd/vet" for
|
|
142724
|
+
// example) as the name. Using the "@" ensures that customers cannot create
|
|
142725
|
+
// name-clashes with these as "@" is an invalid character in Go modules.
|
|
142726
|
+
name = "go-distribution@" + pathDirective.split("\t")[1];
|
|
142727
|
+
}
|
|
142714
142728
|
const modules = [];
|
|
142715
142729
|
versionsLines.forEach((versionLine) => {
|
|
142716
142730
|
const [, name, ver] = versionLine.split("\t");
|
|
@@ -159209,13 +159223,24 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
159209
159223
|
exports.execute = void 0;
|
|
159210
159224
|
const childProcess = __webpack_require__(63129);
|
|
159211
159225
|
function execute(command, args, options, shell = false) {
|
|
159212
|
-
const spawnOptions = { shell };
|
|
159226
|
+
const spawnOptions = { shell, env: process.env };
|
|
159213
159227
|
if (options === null || options === void 0 ? void 0 : options.cwd) {
|
|
159214
159228
|
spawnOptions.cwd = options.cwd;
|
|
159215
159229
|
}
|
|
159216
159230
|
if (options === null || options === void 0 ? void 0 : options.env) {
|
|
159217
159231
|
spawnOptions.env = Object.assign(Object.assign({}, process.env), options.env);
|
|
159218
159232
|
}
|
|
159233
|
+
// Before spawning an external process, we look if we need to restore the system proxy configuration,
|
|
159234
|
+
// which overides the cli internal proxy configuration.
|
|
159235
|
+
if (process.env.SNYK_SYSTEM_HTTP_PROXY !== undefined) {
|
|
159236
|
+
spawnOptions.env.HTTP_PROXY = process.env.SNYK_SYSTEM_HTTP_PROXY;
|
|
159237
|
+
}
|
|
159238
|
+
if (process.env.SNYK_SYSTEM_HTTPS_PROXY !== undefined) {
|
|
159239
|
+
spawnOptions.env.HTTPS_PROXY = process.env.SNYK_SYSTEM_HTTPS_PROXY;
|
|
159240
|
+
}
|
|
159241
|
+
if (process.env.SNYK_SYSTEM_NO_PROXY !== undefined) {
|
|
159242
|
+
spawnOptions.env.NO_PROXY = process.env.SNYK_SYSTEM_NO_PROXY;
|
|
159243
|
+
}
|
|
159219
159244
|
return new Promise((resolve, reject) => {
|
|
159220
159245
|
let stdout = '';
|
|
159221
159246
|
let stderr = '';
|