hygen icon indicating copy to clipboard operation
hygen copied to clipboard

hygen --version treated as error

Open automationghost opened this issue 1 year ago • 0 comments

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

automationghost avatar Jul 15 '24 17:07 automationghost