-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Since there's no other cross-platform solution, can we make this a module like RequiredModules?
- Break it out and stick it back together with ModuleBuilder
- Ship it as a module as well (so I can install it with Install-ModuleFast)
- Make Install-GitHubRelease handle more inputs:
- The {user}/{project} because that's how people frequently refer to them
- The project url https://github.com/[user}/{project}
- A specific release url https://github.com/[user}/{project}/releases/tag/{version}
- Provide a tinyurl so we can run it directly like Install-ModuleFast?
Even better, can we have some sort of combined tool that would call both? - Provide a way to pass a list so I can skip some of this:
# Single-binary dependencies we can install from github
$Tools = @{
# A mapping of the tool to the github user and project
yq = "mikefarah","yq"
kubeconform = "yannh","kubeconform"
conftest = "open-policy-agent","conftest"
flux = "fluxcd","flux2"
}
# Search for them
if ((Get-Command $Tools.Keys -ErrorAction SilentlyContinue -ErrorVariable missing).Count -lt $Tools.Count) {
# Make sure Install-GitHubRelease is here
if (!($installer = Get-Command Install-GitHubRelease -ErrorAction Ignore)) {
Write-Information "Installing Install-GithubRelease"
# The Script path isn't in the PATH on the build servers, so ...
$Script = Install-Script Install-GithubRelease -Force -PassThru
$installer = Get-Command (Join-Path $Script.InstalledLocation $Script.Name)
}
# Index into tools with each missing tool and splat the user & project to Install-GitHubRelease
foreach ($tool in $Tools[$missing.TargetObject]) {
Write-Information "Installing $tool"
&$installer @tool
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels