Prompt issue by creating repository with specified config
Steps to reproduce
I specified all options to create repository not to prompt me any question but It still prompts me the repository base class.
I tried these options by passing config file and other way which is --repositoryBaseClass DefaultCrudRepository way but same behaviour.
My config.json
{
"datasource": "test",
"model": "test",
"repositoryBaseClass": "DefaultCrudRepository"
}
My repository creation CLI command:
b4 repository test --config config.json
Current Behavior
Prompt me to choose a repository base class:
? Please select the repository base class (Use arrow keys)
❯ DefaultCrudRepository (Juggler bridge)
----- Custom Repositories -----
Expected Behavior
Generating repository by specified config without any prompt.
@canmustu as per https://loopback.io/doc/en/lb4/Repository-generator.html#notes
could you please try with -y, --yes Skip all confirmation prompts with default or provided value
like
$ lb4 repository test --config config.json --yes
Worked for me as documented.
➜ hello $ cat config.json
{
"datasource": "test",
"model": "test",
"repositoryBaseClass": "DefaultCrudRepository"
}
➜ hello $ lb4 repository test --config config.json --yes
create src/repositories/test.repository.ts
update src/repositories/index.ts
Repository TestRepository was/were created in src/repositories
➜ hello $ cat src/repositories/test.repository.ts
import {inject} from '@loopback/core';
import {DefaultCrudRepository} from '@loopback/repository';
import {TestDataSource} from '../datasources';
import {Test, TestRelations} from '../models';
export class TestRepository extends DefaultCrudRepository<
Test,
typeof Test.prototype.id,
TestRelations
> {
constructor(
@inject('datasources.test') dataSource: TestDataSource,
) {
super(Test, dataSource);
}
}
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.