Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hygen --version treated as error #450

@automationghost

Description

@automationghost

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions