-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
User can now specify regexes used to find binaries #833
Merged
gdams
merged 11 commits into
adoptium:master
from
jmjaffe37:jmj/generic_windows_installers
Mar 6, 2024
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f5d0d00
reverted CreateSourceFolder
jmjaffe37 b0499d5
Made upstream more generic
jmjaffe37 37a2d5a
Added windows logos to wix installer resources
jmjaffe37 e9bb505
Fixed issues with cmd
jmjaffe37 9dedbe7
Updated jvm finding
jmjaffe37 a46f7ae
Added header and params
jmjaffe37 8bb325b
fixed typo
jmjaffe37 1d2e26e
Updated ARCH for Microsoft
jmjaffe37 1b1566a
Moved windows logos to seperate branch
jmjaffe37 51e3774
Added 'x86' to list of valid inputs
jmjaffe37 b87fa3d
Updated README.md
jmjaffe37 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<# | ||
.SYNOPSIS | ||
This script verifies the validity an input, given a list of possible inputs. | ||
|
||
.DESCRIPTION | ||
The script takes a string as input and checks if it is valid against a list of valid inputs. | ||
If the input is valid, the script returns 0. If the input is invalid, the script returns 1. | ||
|
||
.PARAMETER validInputs | ||
A comma seperated list of valid inputs. | ||
|
||
.PARAMETER toValidate | ||
The input to be verified. | ||
|
||
.PARAMETER delimiter | ||
The delimiter used to split the input string. Default is a space. | ||
|
||
.NOTES | ||
File Name: Validate-Input.ps1 | ||
Author : Joshua Martin-Jaffe | ||
Version : 1.0 | ||
Date : Feb. 29, 2024 | ||
|
||
.EXAMPLE | ||
PS> .\Validate-Input.ps1 -validInputs 'x86-32 x64' -toValidate 'x86-32 x64' -delimiter ' ' | ||
|
||
True | ||
|
||
#> | ||
|
||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[string]$validInputs, | ||
[Parameter(Mandatory = $true)] | ||
[string]$toValidate, | ||
[Parameter(Mandatory = $true)] | ||
[string]$delimiter | ||
) | ||
|
||
$validInputs = $validInputs.Trim("'") | ||
$validInputArray = $validInputs -split "$delimiter" | ||
|
||
$toValidate = $toValidate.Trim("'") | ||
$inputArray = $toValidate -split "$delimiter" | ||
|
||
|
||
for ($i = 0; $i -lt $inputArray.Length; $i++) { | ||
if ($validInputArray -notcontains $inputArray[$i]) { | ||
echo $inputArray[$i] ' is an invalid input' | ||
exit 1 # Invalid input | ||
} | ||
} | ||
exit 0 # Valid input |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
"x86" is missing here.
(I don't know how x86 is different from x86-32 and why it as been added)
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.
x86
is the same asx86-32
. Some vendors (like Microsoft) usex86
instead ofx86-32
so this change helps vendors use this code without local modificationThere 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.
Note, I updated this for you in my latest PR: #851