@ -91,44 +91,54 @@ Write-Host ""
Write-Host "Keyboard Shield Selection:"
Write-Host "Keyboard Shield Selection:"
$prompt = "Pick a keyboard"
$prompt = "Pick a keyboard"
$keyboards = [ordered]@{
{{#keyboards}}
"{{id}}" = @{
name = "{{{name}}}";
type = "{{type}}";
basedir = "{{__base_dir}}";
split = "{{split}}";
arch = "{{arch}}";
siblings = {{#siblings.0}}@(
{{#siblings}}
"{{.}}"
{{/siblings}}
){{/siblings.0}}{{^siblings.0}}( "{{id}}" ){{/siblings.0}};
}
{{/keyboards}}
}
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
$options = {{#keyboards}}"{{name}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$names = {{#keyboards}}"{{id}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$choice = Get-Choice-From-Options -Options ($keyboards.values | % { $_['name'] }) -Prompt $prompt
$types = {{#keyboards}}"{{type}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$keyboard = $($($keyboards.keys)[$choice])
$basedirs = {{#keyboards}}"{{base_dir}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$keyboard_title = $keyboards[$keyboard].name
$splits = {{#keyboards}}"{{#split}}y{{/split}}{{^split}}n{{/split}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$basedir = $keyboards[$keyboard].basedir
$arches = {{#keyboards}}"{{arch}}", {{/keyboards}} "REMOVEME" | Where-Object { $_ -ne "REMOVEME" }
$keyboard_split = $keyboards[$keyboard].split
$basedirs = {{#keyboards}}"{{base_dir}}", {{/keyboards}} "" | Where-Object { $_ -ne "" }
$keyboard_arch = $keyboards[$keyboard].arch
$sibling_sets = {{#keyboards}}{{#siblings.0}}( {{#siblings}}"{{.}}",{{/siblings}} "" | Where-Object { $_ -ne "" } ){{/siblings.0}}{{^siblings.0}}( "{{id}}" ){{/siblings.0}}, {{/keyboards}} "REMOVEME" | Where-Object { $_ -ne "REMOVEME" }
$keyboard_siblings = $keyboards[$keyboard].siblings
$keyboard_type = $keyboards[$keyboard].type
$choice = Get-Choice-From-Options -Options $options -Prompt $prompt
$keyboard_title = $($options[$choice])
$keyboard = $($names[$choice])
$basedir = $($basedirs[$choice])
$keyboard_split = $($splits[$choice])
$keyboard_arch = $($arches[$choice])
$keyboard_siblings = $($sibling_sets[$choice])
$keyboard_type = $($types[$choice])
if ($keyboard_type -eq "shield") {
if ($keyboard_type -eq "shield") {
$prompt = "Pick an MCU board"
$prompt = "Pick an MCU board"
$options = {{#boards}}"{{{name}}}", {{/boards}} "" | Where-Object { $_ -ne "" }
$boards = [ordered]@{
$boards = {{#boards}}"{{id}}", {{/boards}} "" | Where-Object { $_ -ne "" }
{{#boards}}
{{id}} = "{{{name}}}";
{{/boards}}
}
Write-Host "$title"
Write-Host "$title"
Write-Host ""
Write-Host ""
Write-Host "MCU Board Selection:"
Write-Host "MCU Board Selection:"
$choice = Get-Choice-From-Options -Options $option s -Prompt $prompt
$choice = Get-Choice-From-Options -Options $boards.value s -Prompt $prompt
$shields = $keyboard_siblings
$shields = $keyboard_siblings
$board = $($boards[$choice])
$board = $($($ boards.keys) [$choice])
$boards = ( $board )
$boards = ( $board )
} else {
} else {
$boards = ( $keyboard_siblings )
$boards = ( $keyboard_siblings )
$shields = @( )
$shields = @( )
}
}
$copy_keymap = Read-Host "Copy in the stock keymap for customisation? [Yn]"
$copy_keymap = Read-Host "Copy in the stock keymap for customisation? [Yn]"
if ($copy_keymap -eq "" -or $copy_keymap -eq "Y" -or $copy_keymap -eq "y") {
if ($copy_keymap -eq "" -or $copy_keymap -eq "Y" -or $copy_keymap -eq "y") {