From d12aca0d0d393444459e6fbb6b2509597b158ef2 Mon Sep 17 00:00:00 2001 From: Vladyslav Shchepotin Date: Tue, 31 Dec 2024 17:48:09 +0200 Subject: [PATCH] fix: cli for Windows --- .hygen/property/add-to-all-db/index.js | 2 +- .hygen/property/add-to-document/index.js | 2 +- .hygen/property/add-to-relational/index.js | 2 +- docs/cli.md | 12 ++++++------ docs/database.md | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.hygen/property/add-to-all-db/index.js b/.hygen/property/add-to-all-db/index.js index 798624b16..4e282dba3 100644 --- a/.hygen/property/add-to-all-db/index.js +++ b/.hygen/property/add-to-all-db/index.js @@ -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', }, diff --git a/.hygen/property/add-to-document/index.js b/.hygen/property/add-to-document/index.js index c834ed6e4..f31ed4ea8 100644 --- a/.hygen/property/add-to-document/index.js +++ b/.hygen/property/add-to-document/index.js @@ -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', }, diff --git a/.hygen/property/add-to-relational/index.js b/.hygen/property/add-to-relational/index.js index 06aa52b93..c5fd97914 100644 --- a/.hygen/property/add-to-relational/index.js +++ b/.hygen/property/add-to-relational/index.js @@ -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', }, diff --git a/docs/cli.md b/docs/cli.md index 70b5d3298..af8d5433f 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -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) @@ -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 diff --git a/docs/database.md b/docs/database.md index 6aa980a67..1fb46369b 100644 --- a/docs/database.md +++ b/docs/database.md @@ -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) @@ -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)