1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

refactor git-v2#agree with input list (#496)

Co-authored-by: agent <agent@nuc>
This commit is contained in:
fj0r 2023-05-17 10:05:57 +08:00 committed by GitHub
parent b6ecfe3680
commit 08b7ccf84e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,10 @@
def agree [prompt] {
let prompt = if ($prompt | str ends-with '!') {
$'(ansi red)($prompt)(ansi reset) '
$'(ansi red)($prompt)(ansi reset)'
} else {
$'($prompt) '
$'($prompt)'
}
(input $prompt | str downcase) in ['y', 'yes', 'ok', 't', 'true', '1']
([yes no] | input list $prompt) in [yes]
}
# git status and stash