Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hygen --version treated as error #450

Open
automationghost opened this issue Jul 15, 2024 · 0 comments
Open

hygen --version treated as error #450

automationghost opened this issue Jul 15, 2024 · 0 comments

Comments

@automationghost
Copy link

automationghost commented Jul 15, 2024

It seems that the --version output is treated as a error ... while trying to programatically use this

i have to check for for a string :

  ipcMain.handle('check-hygen-command', async () => {
    return new Promise<boolean>((resolve) => {
      exec('hygen --version', (error, stdout, stderr) => {
        if (stdout.includes('Hygen v')) {
          resolve(true);
        } else {
          resolve(false);
        }
      });
    });
  });

instead of niceley resovling like this :)

  ipcMain.handle('check-hygen-command', async () => {
    return new Promise<boolean>((resolve) => {
      exec('hygen --version', (error, stdout, stderr) => {
        if (error) {
          resolve(false);
        } else {
          resolve(true);
        }
      });
    });
  });

hygen --version

Error: please specify a generator.
Hygen v6.2.11

Available actions:
init: init repo, init self

C:\Users\myname>hygen -v

Error: please specify a generator.
Hygen v6.2.11

Available actions:
init: init repo, init self

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant