@@ -60,7 +60,7 @@ const detector = {
60
60
// dependencies (i.e. which dependencies depend on which)
61
61
// eslint-disable-next-line quotes
62
62
// eslint-disable-next-line no-useless-escape
63
- const goListDependencies = ` go list -deps -f ' {{define \"M\\"}}{{.Path}}@{{.Version}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template \\"M\\" .Replace}}{{else}}{{template \\"M\\" .}}{{end}}{{end}}{{end}}'` ;
63
+ const goListDependencies = ' go list -deps -f " {{define \\ "M\\"}}{{.Path}}@{{.Version}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template \\"M\\" .Replace}}{{else}}{{template \\"M\\" .}}{{end}}{{end}}{{end}}"' ;
64
64
// Enumerate directories
65
65
function detect() {
66
66
return __awaiter(this, void 0, void 0, function* () {
@@ -80,16 +80,19 @@ function detect() {
80
80
}
81
81
}
82
82
const metadataInput = core.getInput('metadata');
83
- process.chdir(goModDir);
84
- console.log(`Running go package detection in ${process.cwd()} on build target ${goBuildTarget}`);
85
- const options = { detector };
86
- if (metadataInput) {
87
- const metadata = JSON.parse(metadataInput);
88
- options.metadata = metadata;
89
- }
90
- (0, dependency_submission_toolkit_1.run)(parseDependentsFunc, { command: `${goListDependencies} ${goBuildTarget}` }, options);
83
+ go(goModDir, goBuildTarget, metadataInput);
91
84
});
92
85
}
86
+ function go(goModDir, goBuildTarget, metadataInput) {
87
+ process.chdir(goModDir);
88
+ console.log(`Running go package detection in ${process.cwd()} on build target ${goBuildTarget}`);
89
+ const options = { detector };
90
+ if (metadataInput) {
91
+ const metadata = JSON.parse(metadataInput);
92
+ options.metadata = metadata;
93
+ }
94
+ (0, dependency_submission_toolkit_1.run)(parseDependentsFunc, { command: `${goListDependencies} ${goBuildTarget}` }, options);
95
+ }
93
96
detect();
94
97
95
98
0 commit comments