Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating techutils to support new frogbot feature #891

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions utils/coreutils/techutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ var technologiesData = map[Technology]TechData{
applicabilityScannable: true,
},
Yarn: {
indicators: []string{".yarnrc.yml", "yarn.lock", ".yarn"},
packageDescriptor: "package.json",
packageVersionOperator: "@",
packageInstallationCommand: "up",
applicabilityScannable: true,
indicators: []string{".yarnrc.yml", "yarn.lock", ".yarn"},
packageDescriptor: "package.json",
packageVersionOperator: "@",
applicabilityScannable: true,
},
Go: {
indicators: []string{"go.mod"},
Expand Down Expand Up @@ -168,6 +167,14 @@ func (tech Technology) ApplicabilityScannable() bool {
return technologiesData[tech].applicabilityScannable
}

func (tech Technology) SetPackageInstallationCommand(installationCommand string) {
// this operation is performed like this since we dont want to access the map in yarnPackageHandler, and we dont want to change the map to map[Technology]*TechData
// therefore we cannot change the actual value exists in the map but only a copy of it (go limitation)
updatedTechData := technologiesData[tech]
updatedTechData.packageInstallationCommand = installationCommand
technologiesData[tech] = updatedTechData
}

// DetectTechnologies tries to detect all technologies types according to the files in the given path.
// 'isCiSetup' will limit the search of possible techs to Maven, Gradle, and npm.
// 'recursive' will determine if the search will be limited to files in the root path or not.
Expand Down
Loading