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

Allow override of the dependency name in the Github dependency type #116

Open
mpiederiet opened this issue Jul 9, 2020 · 0 comments · May be fixed by #121
Open

Allow override of the dependency name in the Github dependency type #116

mpiederiet opened this issue Jul 9, 2020 · 0 comments · May be fixed by #121

Comments

@mpiederiet
Copy link

When using a subfolder from a GitHub repository, it would be great to have an option to override the dependency name (or else the module will not successfully import when using invoke-psdepend -import.

Example dependency definition:
'MathieuBuisson/PowerShell-DevOps' = @{
Name = 'Export-NUnitXML'
Version = 'master'
DependencyType = 'GitHub'
Parameters = @{
ExtractPath = 'Export-NUnitXML\Export-NUnitXML.psm1'
}
}

Code to fix this
(PSDependScripts\Github.ps1, line 183)
$DependencyName = if ($Dependency.Name) {$Dependency.Name} Else {$DependencyID.Split("/")[1]}

when using the current code, the import will fail, because it would assume the name to be "PowerShell-DevOps\PowerShell-DevOps.xml", while it is "PowerShell-DevOps\Export-NUnitXML.psm1". I know this is a corner case, but it's only a minor code change which does not affect the original working of the dependency type so I was hoping you would consider adopting it into the PSDepend module.

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

Successfully merging a pull request may close this issue.

1 participant