-
Notifications
You must be signed in to change notification settings - Fork 382
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 build script to install into a versioned directory #1247
Change build script to install into a versioned directory #1247
Conversation
instead of installing into out/PSScriptAnalyzer it will be out/PSScriptAnalyzer/<version> Also add some -force to a number of the ew-item -type directory tests because they cause misleading screen output tracked down one of the tests which was not setting �nv:PSModulePath back correctly
Versioned module directories are not supported, so we need to change the name of the directory from <version> to PSScriptAnalyzer so it can be added to env:PSModulePath and work as expected
9167a5b
to
cbb59cf
Compare
$oldPSModulePath = $env:PSModulePath | ||
$savedPSModulePath = $env:PSModulePath | ||
} | ||
AfterAll { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, there is a Pester issue here whereby using BeforeAll
or AfterAll
inside a Context
block results in unpredictable behaviour. Technically they should be only under a Describe
block. We should address this in another PR as refactoring this test suite is hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yah - I agree - the missing AfterAll
was the reason that the analyzer needed to be installed into a specific location. with this change, that is no longer needed! The test altered $env:PSModulePath
permanently!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I ran the build and tests locally (Windows) on PS 6.2 and 5.1 and it worked fine.
instead of installing into out/PSScriptAnalyzer it will be out/PSScriptAnalyzer/
I also added some
-force
to a number of theNew-item -type directory
tests because they cause misleading screen output because the directory already existed.I fixed one of the tests which was not setting �
$env:PSModulePath
back correctly to its original state.PR Summary
A number of infrastructure and test fixes
PR Checklist
.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
to the beginning of the title and remove the prefix when the PR is ready.