From b794a5e47624db0f22e0d3120d310703e920d113 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sun, 11 Nov 2018 14:11:03 +0100 Subject: [PATCH] sample_prompts/debian_chroot: Clean - Remove begin/end in if-conditions - this used to be necessary in fish < 2.3.0 - Quote a `test` --- .../sample_prompts/debian_chroot.fish | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/share/tools/web_config/sample_prompts/debian_chroot.fish b/share/tools/web_config/sample_prompts/debian_chroot.fish index df54b5f99..b986746f6 100644 --- a/share/tools/web_config/sample_prompts/debian_chroot.fish +++ b/share/tools/web_config/sample_prompts/debian_chroot.fish @@ -11,17 +11,13 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian end # Set variable identifying the chroot you work in (used in the prompt below) - if begin - not set -q debian_chroot - and test -r /etc/debian_chroot - end + if not set -q debian_chroot + and test -r /etc/debian_chroot set debian_chroot (cat /etc/debian_chroot) end - if begin - not set -q __fish_debian_chroot_prompt - and set -q debian_chroot - and test -n $debian_chroot - end + if not set -q __fish_debian_chroot_prompt + and set -q debian_chroot + and test -n "$debian_chroot" set -g __fish_debian_chroot_prompt "($debian_chroot)" end @@ -31,9 +27,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian end switch "$USER" - case root toor - if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root set -g __fish_prompt_cwd (set_color $fish_color_cwd_root) @@ -45,7 +39,6 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" '# ' case '*' - if not set -q __fish_prompt_cwd set -g __fish_prompt_cwd (set_color $fish_color_cwd) end