Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] docker-entrypoint.sh fails with error if no parameters passed #6206

Open
4 of 6 tasks
digininja opened this issue May 7, 2020 · 1 comment
Open
4 of 6 tasks

Comments

@digininja
Copy link
Contributor

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

If no command line argument is passed to docker-entrypoint.sh, when it tries to use $1 on lines 18 and 22 it fails with the error:

./docker-entrypoint.sh: line 22: $1: unbound variable
openapi-generator version

Latest master from Git

OpenAPI declaration file content or url

n/a

Command line used for generation

n/a

Steps to reproduce
$ ./run-in-docker.sh 
++ dirname ./run-in-docker.sh
+ cd .
+ maven_cache_repo=/home/robin/.m2/repository
+ mkdir -p /home/robin/.m2/repository
++ id -u
++ id -g
+ docker run --rm -it -w /gen -e GEN_DIR=/gen -e MAVEN_CONFIG=/var/maven/.m2 -e 'MAVEN_OPTS=-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=/var/maven/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true' -u 1000:1000 -v /tmp/openapi-generator-4.3.1x:/gen -v /tmp/openapi-generator-4.3.1x/CI/run-in-docker-settings.xml:/var/maven/.m2/settings.xml -v /home/robin/.m2/repository:/var/maven/.m2/repository --entrypoint /gen/docker-entrypoint.sh maven:3-jdk-8
/gen/docker-entrypoint.sh: line 18: $1: unbound variable
/gen/docker-entrypoint.sh: line 22: $1: unbound variable
Related issues/PRs

Could not find any

Suggest a fix

I'm submitting a PR to go with this as one way to fix it, but there may be better ways.

@digininja
Copy link
Contributor Author

PR is #6207

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

No branches or pull requests

1 participant