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

Change Compatibility rule logic for finding the module base #1176

Merged
merged 1 commit into from
Mar 15, 2019

Conversation

JamesWTruher
Copy link
Member

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

… 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
Copy link
Contributor

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

Copy link
Collaborator

@bergmeister bergmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bergmeister bergmeister added this to the 1.18 milestone Mar 15, 2019
@JamesWTruher JamesWTruher merged commit aaa24d9 into PowerShell:development Mar 15, 2019
bergmeister pushed a commit to bergmeister/PSScriptAnalyzer that referenced this pull request Mar 22, 2019
… 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
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 this pull request may close these issues.

None yet

3 participants