diff --git a/commands/dorothy b/commands/dorothy index ac4ccfce9..426c8b4f0 100755 --- a/commands/dorothy +++ b/commands/dorothy @@ -1905,6 +1905,13 @@ function dorothy_() ( echo-style --h1='Dorothy Tests' source "$DOROTHY/sources/ripgrep.bash" + # run relevant debugs + __print_lines '' 'debug-terminal-stdin:' + debug-terminal-stdin || : + __print_lines '' 'debug-terminal-tty:' + debug-terminal-tty || : + __print_lines '' + # able to test on bash v3? local bash has_macos_bash_v3='no' bash="$(type -P bash)" @@ -1916,7 +1923,7 @@ function dorothy_() ( local commands filepath filename failures=() scan_paths=( "$DOROTHY/commands/" "$DOROTHY/commands.beta/" - "$DOROTHY/commands.deprecated/" + # "$DOROTHY/commands.deprecated/" <-- don't run deprecated tests, as that will cause deprecated warnings, which cases dorothy-warnings test to fail ) if test -d "$DOROTHY/user"; then if test -d "$DOROTHY/user/commands"; then diff --git a/commands/dorothy-warnings b/commands/dorothy-warnings index 1842f7fef..3b8f5d512 100755 --- a/commands/dorothy-warnings +++ b/commands/dorothy-warnings @@ -64,27 +64,30 @@ function dorothy_warnings() ( # ===================================== # Act + local file="$DOROTHY/state/warnings.txt" + function dorothy_warnings_check { - [[ -s "$DOROTHY/state/warnings.txt" ]] + [[ -s $file ]] return } function dorothy_warnings_clear { - : >"$DOROTHY/state/warnings.txt" + : >"$file" } function dorothy_warnings_list { echo-style --stderr \ --notice1='Dorothy has encountered warnings:' --newline \ - --="$(echo-file -- "$DOROTHY/state/warnings.txt")" --newline \ + --="$(echo-file -- "$file")" --newline \ --notice1='For help with these warnings, see: ' --code-notice1='https://github.com/bevry/dorothy/issues/185' --newline \ --notice1='To clear these warnings, run: ' --code-notice1='dorothy-warnings clear' } function dorothy_warnings_warn { - if [[ -N "$DOROTHY/state/warnings.txt" ]]; then + # -s and -N as if we have cleared the file, that is a new modification, so we need to check if it is actually non-empty AND modified + if [[ -s $file && -N $file ]]; then dorothy_warnings_list fi } function dorothy_warnings_add { - echo-style "${option_args[@]}" >>"$DOROTHY/state/warnings.txt" + echo-style "${option_args[@]}" >>"$file" } case "$action" in