-
Notifications
You must be signed in to change notification settings - Fork 905
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
(GH-1365) Support architecture folder in tools folder #1512
Conversation
foreach (var exeFile in exeFiles) | ||
{ | ||
_fileSystem.create_file(exeFile + ".ignore"); | ||
} |
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.
If there are only 32bit files, what is the expectation here? I think it should probably go ahead and use those files.
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.
@ferventcoder good catch. I have updated this PR with a slight modification.
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.
Somehow your whitespace changes also snuck in.
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.
Small change requested here.
|
||
// If 64bit, and there are only 32bit files, we should shim the 32bit versions, | ||
// therefore, don't ignore anything | ||
if (!exeFiles64Bit.Any() && exeFiles32Bit.Any() && is64Bit) |
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.
Micro-optimization: You should check is64bit
first to short-circuit.
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.
You only need to check if there are no 64bit files prior to returning when 64bit.
return; | ||
} | ||
|
||
foreach (var exeFile in is64Bit ? exeFiles32Bit : exeFiles64Bit) |
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.
Add .or_empty_list_if_null()
to the end of those lists (and be sure that is what it is called, I'm using pseudocode).
@ferventcoder back to you again 😄 |
- This allows the creation of an x86 or x64 folder in tools - Shims will be created, depending on identified arch - No need for install/uninstall script
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.
👍
This allows a Chocolatey Package structure similar to the following:
Which simply contain:
On installation, a
.ignore
file will be created for the alternative architecture (relative to what is being installed):And a shim will be created pointing at the correct architecture:
Fixes #1365