-
Notifications
You must be signed in to change notification settings - Fork 0
param -ConfirmOnce for Mint.Invoke-App tests only once per pipeline #147
Copy link
Copy link
Open
Labels
CommandCmdlets, Functions, AliasesCmdlets, Functions, AliasesCommandLinecli, native commands, etc. comparison with "Command" which means Cmdlet-ishcli, native commands, etc. comparison with "Command" which means Cmdlet-ishenhancementNew feature or requestNew feature or request
Description
Basic implementation currently prompts for every iteration
Mint.Invoke-AppWithConfirm -Name 'git' -CommandLineArgs @( 'add', $_ )
# like
$files | Get-Item -ea 'stop' | % {
Mint.Invoke-AppWithConfirm -Name 'git' -CommandLineArgs @(
'add'
$_
)
}Note
You can add multiple files to git in a single invocation. That's just an example. other commands could include a
block of invokes that can't be simplified
So ignore that the example is git, replace it with anything.
Simple implementation
add an ForEachInput [object[]] parameter.
Mint.Invoke-AppConfirmOnce -Name 'git' -CommandLineArgs @( 'add', $args[0] ) -ForeachInput @( $files )Which Internally calls
function Mint.Invoke-AppConfirmOnce {
# ...
if ( -not ( PromptUserForCommand ) ) { return }
foreach ($Item in $ForEachInput ) {
Mint.Invoke-App git -CommandLineArgs @( 'add', $item )
}
}Or fake AST?
Should allow something like
# confirms once at the top
# invoked n-number of times.
$files | Mint.Invoke-AppConfirmOnce -Name 'git' -CommandLineArgs @( 'add', $args[0] )
# Can I use args? Or do I need to parse the ast, replacing it with the next $INPUT
$files | Mint.Invoke-AppConfirmOnce -Name 'git' -CommandLineArgs @( 'add', $fakeAstItem )Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CommandCmdlets, Functions, AliasesCmdlets, Functions, AliasesCommandLinecli, native commands, etc. comparison with "Command" which means Cmdlet-ishcli, native commands, etc. comparison with "Command" which means Cmdlet-ishenhancementNew feature or requestNew feature or request