diff --git a/functions/_pure_is_inside_container.fish b/functions/_pure_is_inside_container.fish index fcf5067d..594d3bbe 100644 --- a/functions/_pure_is_inside_container.fish +++ b/functions/_pure_is_inside_container.fish @@ -11,7 +11,7 @@ function _pure_is_inside_container \ set --local os_name (uname -s) # echo $os_name - if test $os_name = Linux + if test "$os_name" = Linux if _pure_detect_container_by_cgroup_method $cgroup_namespace return $success end diff --git a/functions/_pure_parse_directory.fish b/functions/_pure_parse_directory.fish index 4fb5cdd5..f28924b5 100644 --- a/functions/_pure_parse_directory.fish +++ b/functions/_pure_parse_directory.fish @@ -4,14 +4,14 @@ function _pure_parse_directory \ set --local folder (fish_prompt_pwd_dir_length=$pure_shorten_prompt_current_directory_length prompt_pwd) - if test -n "$max_path_length"; - if test (string length $folder) -gt $max_path_length; + if test -n "$max_path_length" + if test (string length $folder) -gt $max_path_length # If path exceeds maximum symbol limit, force fish path formating function to use 1 character set folder (fish_prompt_pwd_dir_length=1 prompt_pwd) end end - if test $pure_truncate_prompt_current_directory_keeps -ge 1 + if test "$pure_truncate_prompt_current_directory_keeps" -ge 1 set folder ( string split '/' $folder \ | tail -n $pure_truncate_prompt_current_directory_keeps \ diff --git a/tests/mocks/functions/kubectl.mock.fish b/tests/mocks/functions/kubectl.mock.fish index e0b8fe90..904871ce 100644 --- a/tests/mocks/functions/kubectl.mock.fish +++ b/tests/mocks/functions/kubectl.mock.fish @@ -4,11 +4,11 @@ function kubectl \ topcommand \ subcommand - if test $topcommand = config + if test "$topcommand" = config if test $subcommand = current-context echo my-context end - if test $subcommand = view + if test "$subcommand" = view echo my-namespace end else diff --git a/tools/installer.fish b/tools/installer.fish index 13d6fe02..c857aa14 100644 --- a/tools/installer.fish +++ b/tools/installer.fish @@ -34,7 +34,7 @@ function pure_fetch_source set --local package "https://github.com/pure-fish/pure/archive/master.tar.gz" mkdir -p $PURE_INSTALL_DIR - command curl --silent --show-error --location "$package" | command tar -xzf- -C $PURE_INSTALL_DIR --strip-components=1; or begin; + command curl --silent --show-error --location "$package" | command tar -xzf- -C $PURE_INSTALL_DIR --strip-components=1; or begin printf "%sError: fetching Pure sources failed%s" "$color_error" "$color_normal" return 1 end @@ -46,7 +46,8 @@ function pure_backup_existing_theme set --local backup_prompt $old_prompt.ignore if test -f "$old_prompt" - mv "$old_prompt" "$backup_prompt"; pure_exit_symbol $status + mv "$old_prompt" "$backup_prompt" + pure_exit_symbol $status printf "\tPrevious config saved to: %s%s%s." "$color_white" "$backup_prompt" "$color_normal" end end @@ -55,9 +56,9 @@ function pure_enable_autoloading printf "\tEnabling autoloading for pure's functions on shell init" touch "$FISH_CONFIG_DIR/config.fish" if not grep -q "pure.fish" $FISH_CONFIG_DIR/config.fish - echo "# THEME PURE #" >> $FISH_CONFIG_DIR/config.fish - echo "set fish_function_path $PURE_INSTALL_DIR/functions/" '$fish_function_path' >> $FISH_CONFIG_DIR/config.fish - echo "source $PURE_INSTALL_DIR/conf.d/pure.fish" >> $FISH_CONFIG_DIR/config.fish + echo "# THEME PURE #" >>$FISH_CONFIG_DIR/config.fish + echo "set fish_function_path $PURE_INSTALL_DIR/functions/" '$fish_function_path' >>$FISH_CONFIG_DIR/config.fish + echo "source $PURE_INSTALL_DIR/conf.d/pure.fish" >>$FISH_CONFIG_DIR/config.fish end end @@ -97,7 +98,7 @@ function pure_error end function pure_exit_symbol - if test $argv[1] -eq 0 + if test "$argv[1]" -eq 0 pure_success else pure_error @@ -108,11 +109,18 @@ function install_pure printf "Installing Pure theme\n" pure_set_fish_config_path $argv pure_set_pure_install_path $argv - pure_scaffold_fish_directories; pure_exit_symbol $status - pure_fetch_source; pure_exit_symbol $status - pure_backup_existing_theme; pure_exit_symbol $status - pure_enable_autoloading; pure_exit_symbol $status - pure_symlinks_assets; pure_exit_symbol $status - pure_enable_theme; pure_exit_symbol $status - pure_clean_after_install; pure_exit_symbol $status + pure_scaffold_fish_directories + pure_exit_symbol $status + pure_fetch_source + pure_exit_symbol $status + pure_backup_existing_theme + pure_exit_symbol $status + pure_enable_autoloading + pure_exit_symbol $status + pure_symlinks_assets + pure_exit_symbol $status + pure_enable_theme + pure_exit_symbol $status + pure_clean_after_install + pure_exit_symbol $status end