Skip to content

Commit

Permalink
Fix bug when jas_scanner/jas_scanner.exe are the same file
Browse files Browse the repository at this point in the history
  • Loading branch information
guyshe-jfrog committed May 30, 2024
1 parent 5a2fd65 commit e219ed3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions jas/external_files/jasutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ func SwapScanners(destinationSuffixFolder string, destinationExecutableName stri
if err != nil {
panic(err)
}

if runtime.GOOS == "windows" {
_, err = copy(filepath.Join(analyzerManagerPath, "jas_scanner.exe"), filepath.Join(analyzerManagerPath, destinationExecutableName+".exe"))
} else {
_, err = copy(filepath.Join(analyzerManagerPath, "jas_scanner"), filepath.Join(analyzerManagerPath, destinationExecutableName))
}
if err != nil {
panic(err)
if destinationExecutableName != "jas_scanner" {
if runtime.GOOS == "windows" {
_, err = copy(filepath.Join(analyzerManagerPath, "jas_scanner.exe"), filepath.Join(analyzerManagerPath, destinationExecutableName+".exe"))
} else {
_, err = copy(filepath.Join(analyzerManagerPath, "jas_scanner"), filepath.Join(analyzerManagerPath, destinationExecutableName))
}
if err != nil {
panic(err)
}
}

switch runtime.GOOS {
Expand Down

0 comments on commit e219ed3

Please sign in to comment.