Skip to content

Generate.ps1 does not support macOS #975

Open

Description

Describe the issue or request
Playing around with the tests, I wanted to regenerate some code and tried Generate.ps1. It gave me this on macOS:

$ pwsh eng/Generate.ps1

cmd: /Users/donblas/Programming/autorest.csharp/eng/Generation.psm1:15
Line |
  15 |          cmd /c "$command 2>&1"
     |          ~~~
     | The term 'cmd' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Obviously cmd doesn't exist on macOS.

Describe your ideas for solutions

The code in question:

    if ($IsLinux)
    {
        sh -c "$command 2>&1"
    }
    else
    {
        cmd /c "$command 2>&1"
    }

Hacking this to unconditionally do sh seemed to get me further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis issue requires a new behavior in the product in order be resolved.help wantedThis issue is tracking work for which community contributions would be welcomed and appreciatedinstances<5Less than 5 instances that need a workaround.v3Version 3 of AutoRest C# generator.workaround-mediumWorking around the problem is somewhat difficult.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions