Skip to content

Commit

Permalink
Second try to fix issue psget#12, module not from child directory
Browse files Browse the repository at this point in the history
  • Loading branch information
chaliy committed Feb 5, 2012
1 parent 9ffcbdf commit 0267d7e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PsGet/PsGet.psm1
Expand Up @@ -95,7 +95,7 @@ Param(
# Let’s try guessing module name
if ($ModuleName -eq ""){
$BestCandidateModule = (Get-ChildItem $TempModuleFolderPath -Filter "*.psm1" -Recurse -File |
Sort-Object DirectoryName.Length -Desc |
Sort-Object DirectoryName.Length -Desc | # Sort by folder length ensures that we use one from root folder(Issue #12)
Select-Object -Index 0).FullName
$ModuleName = [IO.Path]::GetFileNameWithoutExtension($BestCandidateModule)
}
Expand Down Expand Up @@ -379,7 +379,9 @@ Param(
}

if ($ModuleName -eq ""){
$BestCandidateModule = (Get-ChildItem $TempModuleFolderPath -Filter "*.psm1" -Recurse | select -Index 0).FullName
$BestCandidateModule = (Get-ChildItem $TempModuleFolderPath -Filter "*.psm1" -Recurse -File |
Sort-Object DirectoryName.Lenght -Desc | # Sort by folder length ensures that we use one from root folder(Issue #12)
Select-Object -Index 0).FullName
$ModuleName = [IO.Path]::GetFileNameWithoutExtension($BestCandidateModule)
}

Expand Down

0 comments on commit 0267d7e

Please sign in to comment.