Skip to content

Commit

Permalink
change error and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RomKadria committed Feb 28, 2024
1 parent 67a2376 commit 779e251
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @mondaycom/apps-cli
$ mapps COMMAND
running command...
$ mapps (--version)
@mondaycom/apps-cli/2.3.4 darwin-arm64 node-v18.19.0
@mondaycom/apps-cli/2.3.4 darwin-arm64 node-v18.12.1
$ mapps --help [COMMAND]
USAGE
$ mapps COMMAND
Expand Down Expand Up @@ -49,15 +49,15 @@ USAGE

## `mapps api:generate`

Prepares your environment for custom queries development.
Prepares your environment for custom queries development. run it from your root directory!

```
USAGE
$ mapps api:generate
DESCRIPTION
Prepares your environment for custom queries development.
run it from your root directory and it will create all neccesary files and scripts
Prepares your environment for custom queries development. run it from your root directory!
Creates all neccesary files and scripts
to start working with custom api queries and mutations.
```

Expand Down
14 changes: 7 additions & 7 deletions src/commands/api/generate.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { spawn } from 'node:child_process';

import { Command } from '@oclif/core';

import { BaseCommand } from 'commands-base/base-command';
import logger from 'utils/logger';

export default class ApiGenerate extends Command {
export default class ApiGenerate extends BaseCommand {
DEBUG_TAG = 'api:generate';

static description = `Prepares your environment for custom queries development.
run it from your root directory and it will create all neccesary files and scripts
static description = `Prepares your environment for custom queries development. run it from your root directory!
Creates all neccesary files and scripts
to start working with custom api queries and mutations.`;

async run() {
Expand All @@ -18,18 +17,19 @@ export default class ApiGenerate extends Command {
} catch (error) {
logger.debug(error, this.DEBUG_TAG);
logger.error(`setup-api failed, please make sure you run it in your root directory and try again}`);
throw error;
}
}

runSetupApi() {
return new Promise<void>((resolve, reject) => {
const setupApiProcess = spawn('npx', ['setup-api-monday@^1.0.0'], { stdio: 'inherit' });
const setupApiProcess = spawn('npx', ['@mondaydotcomorg/setup-api@^1.0.0'], { stdio: 'inherit' });

setupApiProcess.on('close', code => {
if (code === 0) {
resolve();
} else {
reject(code);
reject(new Error(`Process exited with code ${code}`));
}
});

Expand Down

0 comments on commit 779e251

Please sign in to comment.