Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

customScanner broken / calls own shell script sonar-scanner #141

Closed
robaca opened this issue Jul 7, 2022 · 8 comments
Closed

customScanner broken / calls own shell script sonar-scanner #141

robaca opened this issue Jul 7, 2022 · 8 comments

Comments

@robaca
Copy link

robaca commented Jul 7, 2022

Hi,

we just have the issue, that we try to use the customScanner export, as we get another error when downloading the scanner via the library. Now we found out, that the getLocalSonarScannerExecutable() calls the own binary script from <module-root>/bin/sonar-scanner instead of calling the correct binary from the path.

As it's currently not possible to define a custom path explicitly, the customScanner functionality seems to be broken completely.

Best regards,
Carsten

@gabssnake
Copy link
Collaborator

Hey @robaca can you confirm this is still an a problem? Have you found a workaround?

@robaca
Copy link
Author

robaca commented Sep 26, 2022

Hi @gabssnake we worked around the problem via

sed -i -e "s|var command = 'sonar-scanner'|var command = '/opt/sonar-scanner/bin/sonar-scanner'|g" node_modules/sonarqube-scanner/dist/sonar-scanner-executable.js

@gabssnake
Copy link
Collaborator

Thanks for the feedback! Do you want to try a PR?

@romanbalayan
Copy link
Contributor

Hi @robaca, @gabssnake,

If I understand correctly, the customScanner should work? Although not explicit on the README, should work if the local installation of sonar-scanner is defined in environment $PATH variable.

Maybe the use case can be clarified on the sample usage documentation.

@romanbalayan
Copy link
Contributor

Hi @gabssnake ,

Created PR : #157 for this.

Also full disclosure, doing this as part of Hacktoberfest 2022.

Thanks.

@gabssnake
Copy link
Collaborator

Hi @romanbalayan, that makes sense. Also I think depending on the environment, it might be tricky to set.

@robaca can you confirm that @romanbalayan suggestion works in your case?

@romanbalayan
Copy link
Contributor

Hi @gabssnake,

I agree that the specific step on how to set the environment variable is tricky (as this heavily depends on the system where the application will be running, etc) - but I guess its important to explicitly specify that it should be set.

@gabssnake
Copy link
Collaborator

See #157

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants