Skip to content

Commit d499e48

Browse files
Merge pull request #104 from diegopereiraeng/main
Changing new parameters defaults to false
2 parents db1c296 + 74ead2a commit d499e48

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,12 @@ func main() {
272272
Usage: "sonar scanner jvm ops",
273273
EnvVar: "PLUGIN_SONAR_SCANNER_OPTS",
274274
},
275-
cli.BoolTFlag{
275+
cli.BoolFlag{
276276
Name: "sonar_config_file",
277277
Usage: "Use sonar-project.properties if available",
278278
EnvVar: "PLUGIN_SONAR_CONFIG_FILE",
279279
},
280-
cli.BoolTFlag{
280+
cli.BoolFlag{
281281
Name: "sonar_config_file_override",
282282
Usage: "Use sonar-project.properties if available and override host, login or/and project key",
283283
EnvVar: "PLUGIN_SONAR_CONFIG_FILE_OVERRIDE",

plugin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ func PreFlightGetLatestTaskID(config Config) (string, error) {
418418
func (p Plugin) Exec() error {
419419
// Check if the sonar-project.properties file exists in the current directory
420420
sonarConfigFile := "sonar-project.properties"
421-
_, err := os.Stat(sonarConfigFile)
422421

423422
args := []string{}
424423

@@ -431,6 +430,8 @@ func (p Plugin) Exec() error {
431430
args = append(args, "-Dsonar.projectBaseDir="+p.Config.Workspace)
432431
}
433432

433+
_, err := os.Stat(sonarConfigFile)
434+
434435
if os.IsNotExist(err) || !p.Config.UseSonarConfigFile {
435436
// If the configuration file does not exist, use the default parameters
436437
fmt.Println("Configuration file not found. Using default parameters.")

0 commit comments

Comments
 (0)