OpenAPITools / OpenAPITools/openapi-generator
[REQ] Harden `new.sh` to create directory structures if they don't already exist
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
I'm using the new.sh script to create a new custom generator, but I'm doing so outside of the context of the openapi-generator repository. The script breaks in a few locations since it it assumes that a directory structure already exists.
I've gone through my copy and added a series of mkdir -p commands before various echo and cat commands, but wanted to suggest that these lines get added to the script for other devs who might want to create custom templates without the baggage of an entire fork.
Describe the solution you'd like
Add in mkdir -p commands to new.sh before writing to a file that assumes a given directory exists.
Describe alternatives you've considered
The alternatives are:
- Bespoke manual editing of
new.sh - Running it in the context of the
openapi-generatorrepository.
Additional context
I'd be happy to open a PR for this if it's acceptable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading new.sh and identify each echo or cat command that writes into a directory assumed to exist. Add the requested directory creation before those writes, then verify that the script can create a custom generator outside the openapi-generator repository without pre-existing directory structures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100