Skip to content

Conversation

@ktanable1
Copy link

Quote bash args.

Hi devs, there's a bug in the detect-sh.sh specifically,

https://github.com/synopsys-sig/synopsys-detect-scripts/blob/e9a657b7db245c2f5996ec93ab5b84e078285102/src/main/resources/detect-sh.sh#L76

where quoted parameters passed in from bash (shell) will lose their grouping.

E.g.

bash detect.sh --blackduck.url='https://a.b.c' --detect.project.name='foo' --detect.project.version.name="bar" --detect.source.path=./ --detect.maven.build.command="--settings=./settings.xml -DskipTests=true -Dmaven.repo.local=./.repository"

produces:
Detect Version: 6.8.0

2021-03-23 23:35:36 INFO [main] ---
2021-03-23 23:35:36 INFO [main] --- Current property values:
2021-03-23 23:35:36 INFO [main] --- --property = value [notes]
2021-03-23 23:35:36 INFO [main] --- ------------------------------------------------------------
2021-03-23 23:35:36 INFO [main] --- blackduck.url = https://a.b.c [cmd]
2021-03-23 23:35:36 INFO [main] --- detect.maven.build.command = --settings=./settings.xml [cmd]
2021-03-23 23:35:36 INFO [main] --- detect.project.name = foo [cmd]
2021-03-23 23:35:36 INFO [main] --- detect.project.version.name = bar [cmd]
2021-03-23 23:35:36 INFO [main] --- detect.source.path = ./ [cmd]
2021-03-23 23:35:36 INFO [main] --- ------------------------------------------------------------

should instead be:
Detect Version: 6.8.0

2021-03-23 23:35:07 INFO [main] ---
2021-03-23 23:35:07 INFO [main] --- Current property values:
2021-03-23 23:35:07 INFO [main] --- --property = value [notes]
2021-03-23 23:35:07 INFO [main] --- ------------------------------------------------------------
2021-03-23 23:35:07 INFO [main] --- blackduck.url = https://a.b.c [cmd]
2021-03-23 23:35:07 INFO [main] --- detect.maven.build.command = --settings=./settings.xml -DskipTests=true -Dmaven.repo.local=./.repository [cmd]
2021-03-23 23:35:07 INFO [main] --- detect.project.name = foo [cmd]
2021-03-23 23:35:07 INFO [main] --- detect.project.version.name = bar [cmd]
2021-03-23 23:35:07 INFO [main] --- detect.source.path = ./ [cmd]
2021-03-23 23:35:07 INFO [main] --- ------------------------------------------------------------

Thanks.

Quote bash args.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant