Skip to content

Commit

Permalink
api:generate cli option
Browse files Browse the repository at this point in the history
  • Loading branch information
RomKadria committed Feb 16, 2024
1 parent 368ba62 commit 9546f82
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/commands/api/generate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { spawn } from 'node:child_process';

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

import logger from 'utils/logger';

export default class ApiGenerate extends Command {
// TODO: yarn add @mondaycom/setup-api - when this package is published

Check warning on line 8 in src/commands/api/generate.ts

View workflow job for this annotation

GitHub Actions / Run validations

Unexpected 'todo' comment: 'TODO: yarn add @mondaycom/setup-api -...'
static description = 'Run the setup-api-monday command from @mondaycom/setup-api';

async run() {
const setupApiProcess = spawn('npx', ['setup-api-monday'], { stdio: 'inherit' });

setupApiProcess.on('close', code => {
if (code === 0) {
logger.info('setup-api completed successfully.');
} else {
logger.error(`setup-api process exited with an error. Exit code: ${code}`);
}
});
}
}

0 comments on commit 9546f82

Please sign in to comment.