Skip to content

Commit

Permalink
fix: cli for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchepotin committed Dec 31, 2024
1 parent c6c424a commit d12aca0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .hygen/property/add-to-all-db/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = {
result.referenceType === 'oneToMany'
) {
execSync(
`npm run add:property:to-all-db -- --name=${result.type} --property=${result.propertyInReference} --propertyInReference=${result.property} --kind=${result.kind} --type=${result.name} --referenceType=manyToOne --isAddToDto=${result.isAddToDto} --isOptional=false --isNullable=false`,
`npm run add:property:to-all-db -- --name ${result.type} --property ${result.propertyInReference} --propertyInReference ${result.property} --kind ${result.kind} --type ${result.name} --referenceType manyToOne --isAddToDto ${result.isAddToDto} --isOptional false --isNullable false`,
{
stdio: 'inherit',
},
Expand Down
2 changes: 1 addition & 1 deletion .hygen/property/add-to-document/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = {
result.referenceType === 'oneToMany'
) {
execSync(
`npm run add:property:to-document -- --name=${result.type} --property=${result.propertyInReference} --propertyInReference=${result.property} --kind=${result.kind} --type=${result.name} --referenceType=manyToOne --isAddToDto=${result.isAddToDto} --isOptional=false --isNullable=false`,
`npm run add:property:to-document -- --name ${result.type} --property ${result.propertyInReference} --propertyInReference ${result.property} --kind ${result.kind} --type ${result.name} --referenceType manyToOne --isAddToDto ${result.isAddToDto} --isOptional false --isNullable false`,
{
stdio: 'inherit',
},
Expand Down
2 changes: 1 addition & 1 deletion .hygen/property/add-to-relational/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = {
result.referenceType === 'oneToMany'
) {
execSync(
`npm run add:property:to-relational -- --name=${result.type} --property=${result.propertyInReference} --propertyInReference=${result.property} --kind=${result.kind} --type=${result.name} --referenceType=manyToOne --isAddToDto=${result.isAddToDto} --isOptional=false --isNullable=false`,
`npm run add:property:to-relational -- --name ${result.type} --property ${result.propertyInReference} --propertyInReference ${result.property} --kind ${result.kind} --type ${result.name} --referenceType manyToOne --isAddToDto ${result.isAddToDto} --isOptional false --isNullable false`,
{
stdio: 'inherit',
},
Expand Down
12 changes: 6 additions & 6 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ Generate resource with the following commands:
### For document oriented database (MongoDB + Mongoose)

```bash
npm run generate:resource:document -- --name=ResourceName
npm run generate:resource:document -- --name ResourceName
```

Example:

```bash
npm run generate:resource:document -- --name=Category
npm run generate:resource:document -- --name Category
```

### For relational database (PostgreSQL + TypeORM)

```bash
npm run generate:resource:relational -- --name=ResourceName
npm run generate:resource:relational -- --name ResourceName
```

Example:

```bash
npm run generate:resource:relational -- --name=Category
npm run generate:resource:relational -- --name Category
```

#### Video guideline for relational database (PostgreSQL + TypeORM)
Expand All @@ -52,13 +52,13 @@ npm run generate:resource:relational -- --name=Category
### For both databases

```bash
npm run generate:resource:all-db -- --name=ResourceName
npm run generate:resource:all-db -- --name ResourceName
```

Example:

```bash
npm run generate:resource:all-db -- --name=Category
npm run generate:resource:all-db -- --name Category
```

## Add property to resource
Expand Down
4 changes: 2 additions & 2 deletions docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ npm run schema:drop

### Creating seeds (TypeORM)

1. Create seed file with `npm run seed:create:relational -- --name=Post`. Where `Post` is name of entity.
1. Create seed file with `npm run seed:create:relational -- --name Post`. Where `Post` is name of entity.
1. Go to `src/database/seeds/relational/post/post-seed.service.ts`.
1. In `run` method extend your logic.
1. Run [npm run seed:run:relational](#run-seed-typeorm)
Expand Down Expand Up @@ -253,7 +253,7 @@ npm run seed:run:relational
### Creating seeds (Mongoose)
1. Create seed file with `npm run seed:create:document -- --name=Post`. Where `Post` is name of entity.
1. Create seed file with `npm run seed:create:document -- --name Post`. Where `Post` is name of entity.
1. Go to `src/database/seeds/document/post/post-seed.service.ts`.
1. In `run` method extend your logic.
1. Run [npm run seed:run:document](#run-seed-mongoose)
Expand Down

0 comments on commit d12aca0

Please sign in to comment.