nu: rewatch - revert uncatchable try/catch
This commit is contained in:
@@ -16,15 +16,13 @@ def ports [] {
|
||||
|
||||
# Repeatedly clears and reruns a closure — nu-native watch replacement
|
||||
def rewatch [interval: duration, cmd: closure] {
|
||||
try {
|
||||
loop {
|
||||
clear
|
||||
let dim = $env.config.color_config.hints
|
||||
print $"(ansi { fg: $dim })(date now | format date '%H:%M:%S')(ansi reset)"
|
||||
do $cmd | print
|
||||
sleep $interval
|
||||
}
|
||||
} catch { null }
|
||||
loop {
|
||||
clear
|
||||
let dim = $env.config.color_config.hints
|
||||
print $"(ansi { fg: $dim })(date now | format date '%H:%M:%S')(ansi reset)"
|
||||
do $cmd | print
|
||||
sleep $interval
|
||||
}
|
||||
}
|
||||
|
||||
# Environment variables as a filterable sorted table
|
||||
|
||||
Reference in New Issue
Block a user