Skip to content

Get-BuildVariables fails if git is aliased to hub.exe #80

Description

@RandomNoun7

hub is a tool put out by github that adds capabilities to git. The recommended way to use hub is to alias git to hub.exe, so that it can transparently handle the things it knows how to handle, and just pass on any commands that it doesn't.

When executing Get-BuildVariables cmdlet the line that attempts to find the path to git.exe uses the Get-Command cmdlet. This will not work in cases where git is aliased as no Path property is returned.

A different approach that either finds git.exe directly by looking at paths in the PATH variable, or one that accepts an alias, may be needed to support this scenario on workstations.

While this error should rarely or never be encountered on the build servers this module is intended to be used on, it is also used on developer workstations where this error can reasonable be expected crop up once in a while.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions