OpenAPITools / OpenAPITools/openapi-generator

[REQ] Harden `new.sh` to create directory structures if they don't already exist

Open
#18,727 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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:

  1. Bespoke manual editing of new.sh
  2. Running it in the context of the openapi-generator repository.

Additional context

I'd be happy to open a PR for this if it's acceptable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.