Skip to content

Commit

Permalink
🐛 Fix windows distribution lookup (QD-9693)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Aug 1, 2024
1 parent 5ae43ee commit 482ea74
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
10 changes: 5 additions & 5 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,10 @@ func TestAllCommandsWithContainer(t *testing.T) {
}

func TestScanWithIde(t *testing.T) {
err := os.Setenv("QD_PRODUCT_INTERNAL_FEED", "https://data.services.jetbrains.com/products")
if err != nil {
t.Fatal(err)
}
//err := os.Setenv("QD_PRODUCT_INTERNAL_FEED", "https://data.services.jetbrains.com/products")
//if err != nil {
// t.Fatal(err)
//}
log.SetLevel(log.DebugLevel)
token := os.Getenv("QODANA_LICENSE_ONLY_TOKEN")
if //goland:noinspection GoBoolExpressions
Expand All @@ -412,7 +412,7 @@ func TestScanWithIde(t *testing.T) {
}
projectPath := ".."
resultsPath := filepath.Join(projectPath, "results")
err = os.MkdirAll(resultsPath, 0o755)
err := os.MkdirAll(resultsPath, 0o755)
if err != nil {
t.Fatal(err)
}
Expand Down
16 changes: 8 additions & 8 deletions core/installers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
)

func TestGetIde(t *testing.T) {
err := os.Setenv("QD_PRODUCT_INTERNAL_FEED", "https://data.services.jetbrains.com/products")
if err != nil {
t.Fatal(err)
}
//err := os.Setenv("QD_PRODUCT_INTERNAL_FEED", "https://data.services.jetbrains.com/products")
//if err != nil {
// t.Fatal(err)
//}
for _, installer := range platform.AllNativeCodes {
//ide := getIde(installer)
//if ide == nil {
Expand All @@ -42,10 +42,10 @@ func TestGetIde(t *testing.T) {
}

func TestDownloadAndInstallIDE(t *testing.T) {
err := os.Setenv("QD_PRODUCT_INTERNAL_FEED", "https://data.services.jetbrains.com/products")
if err != nil {
t.Fatal(err)
}
//err := os.Setenv("QD_PRODUCT_INTERNAL_FEED", "https://data.services.jetbrains.com/products")
//if err != nil {
// t.Fatal(err)
//}
ides := []string{"QDGO-EAP"}
for _, ide := range ides {
DownloadAndInstallIDE(ide, t)
Expand Down
4 changes: 4 additions & 0 deletions core/product_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ func guessProduct(opts *QodanaOptions) {
if _, err := os.Stat(contentsDir); err == nil {
Prod.Home = contentsDir
}
} else if runtime.GOOS == "windows" {
if dirs, err := filepath.Glob(filepath.Join(Prod.Home, "*")); err == nil && len(dirs) == 1 {
Prod.Home = dirs[0]
}
}
if Prod.Home == "" {
if home, ok := os.LookupEnv(platform.QodanaDistEnv); ok {
Expand Down

0 comments on commit 482ea74

Please sign in to comment.