snyk-nuget-plugin 2.7.1 → 2.7.3
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function validate(): Promise<string>;
|
|
2
|
-
export declare function restore(projectPath: string): Promise<
|
|
2
|
+
export declare function restore(projectPath: string): Promise<void>;
|
|
3
3
|
export declare function run(projectPath: string, options: string[]): Promise<string>;
|
|
4
4
|
export declare function publish(projectPath: string, targetFramework?: string): Promise<string>;
|
|
@@ -5,7 +5,6 @@ exports.restore = restore;
|
|
|
5
5
|
exports.run = run;
|
|
6
6
|
exports.publish = publish;
|
|
7
7
|
const debugModule = require("debug");
|
|
8
|
-
const errors = require("../../errors");
|
|
9
8
|
const errors_1 = require("../../errors");
|
|
10
9
|
const path = require("path");
|
|
11
10
|
const subprocess = require("./subprocess");
|
|
@@ -48,22 +47,10 @@ async function restore(projectPath) {
|
|
|
48
47
|
// Useful for customers to attempt self-debugging before raising support requests.
|
|
49
48
|
'--verbosity',
|
|
50
49
|
'normal',
|
|
51
|
-
projectPath
|
|
50
|
+
`"${projectPath}"`,
|
|
52
51
|
];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// get picked up by the dotnet tool and reported in the output logs.
|
|
56
|
-
const regex = /Path:\s+(\S+project.assets.json)/g;
|
|
57
|
-
const matches = result.stdout.matchAll(regex);
|
|
58
|
-
const manifestFiles = [];
|
|
59
|
-
for (const match of matches) {
|
|
60
|
-
manifestFiles.push(match[1]);
|
|
61
|
-
}
|
|
62
|
-
if (manifestFiles.length === 0) {
|
|
63
|
-
throw new errors.FileNotProcessableError('found no information in stdout about the whereabouts of the assets file');
|
|
64
|
-
}
|
|
65
|
-
// Return the last element in the log, as it might be mentioning local asset files in reverse order.
|
|
66
|
-
return manifestFiles[manifestFiles.length - 1];
|
|
52
|
+
await handle('restore', command, args);
|
|
53
|
+
return;
|
|
67
54
|
}
|
|
68
55
|
async function run(projectPath, options) {
|
|
69
56
|
const command = 'dotnet';
|
|
@@ -85,9 +72,6 @@ async function publish(projectPath, targetFramework) {
|
|
|
85
72
|
args.push('--framework');
|
|
86
73
|
args.push(targetFramework);
|
|
87
74
|
}
|
|
88
|
-
// See https://devblogs.microsoft.com/nuget/enable-repeatable-package-restores-using-a-lock-file/
|
|
89
|
-
// Forces the usage of the lockfile for PackageReference packages to ensure that the locked versions are published
|
|
90
|
-
args.push('-p:RestoreLockedMode=true');
|
|
91
75
|
// Define a temporary output dir to use for detecting .dlls to use for runtime version assembly detection.
|
|
92
76
|
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), `snyk-nuget-plugin-publish-csharp-`));
|
|
93
77
|
// See https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/7.0/solution-level-output-no-longer-valid#recommended-action
|
|
@@ -95,7 +79,7 @@ async function publish(projectPath, targetFramework) {
|
|
|
95
79
|
args.push(`--property:PublishDir=${tempDir}`);
|
|
96
80
|
// The path that contains either some form of project file, or a .sln one.
|
|
97
81
|
// See: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#arguments
|
|
98
|
-
args.push(projectPath);
|
|
82
|
+
args.push(`"${projectPath}"`);
|
|
99
83
|
await handle('publish', command, args);
|
|
100
84
|
return tempDir;
|
|
101
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotnet.js","sourceRoot":"","sources":["../../../lib/nuget-parser/cli/dotnet.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"dotnet.js","sourceRoot":"","sources":["../../../lib/nuget-parser/cli/dotnet.ts"],"names":[],"mappings":";;AAuCA,4BAWC;AAED,0BAYC;AAED,kBAQC;AAED,0BAoCC;AAhHD,qCAAqC;AACrC,yCAA+C;AAC/C,6BAA6B;AAC7B,2CAA2C;AAC3C,yBAAyB;AACzB,yBAAyB;AAEzB,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAElC,KAAK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