Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upChange Compatibility rule logic for finding the module base #1176
Conversation
… file This is because we might be installed in a versioned directory, rather than the a directory name PSScriptAnalyzer, we'll be in PSScriptAnalyzer/1.18.0
|
Good catch |
|
There's a lot of hard-coding. For a quick-fix before the release it's fine but we should create an item to move the binaries of v5 into it's own folder so that we do not need to have such a logic. Also: we should improve our test setup to deploy PSSA in a named folder |
| psmPath = Path.Combine(nonNormalizedRoot, psdFile); | ||
| if ( ! File.Exists(psmPath) ) { | ||
| // Couldn't find it, give up | ||
| return String.Empty; |
This comment has been minimized.
This comment has been minimized.
bergmeister
Mar 15, 2019
Collaborator
Should we not rather throw? If a user accidentally deletes/moves/rename the file in the installation folder, then we'd have an actionable error message
… file (PowerShell#1176) This is because we might be installed in a versioned directory, rather than the a directory name PSScriptAnalyzer, we'll be in PSScriptAnalyzer/1.18.0

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

JamesWTruher commentedMar 14, 2019
PR Summary
Now hunt for the PSScriptAnalyzer.psd1 file.
This is because we might be installed in a versioned directory, rather than the directory name PSScriptAnalyzer, we might be in PSScriptAnalyzer/1.18.0
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.