From 9feaaa8cf04fabff71e612ae2e255b8ca1ace0fe Mon Sep 17 00:00:00 2001
From: Steve Mckellar <steve@thingmaker.io>
Date: Mon, 3 Nov 2014 20:21:56 +0000
Subject: [PATCH] Stops theme breaking on root directory

---
 themes/toaster/fish_prompt.fish | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/themes/toaster/fish_prompt.fish b/themes/toaster/fish_prompt.fish
index df6dfba..461879b 100644
--- a/themes/toaster/fish_prompt.fish
+++ b/themes/toaster/fish_prompt.fish
@@ -10,11 +10,17 @@ set __toaster_color_lilac AE81FF
 
 function __toaster_color_echo
   set_color $argv[1]
-  echo -n $argv[2]
+  if test (count $argv) -eq 2
+    echo -n $argv[2]
+  end
 end
 
 function __toaster_current_folder
-  echo -n $PWD | grep -o -E '[^\/]+$'
+  if test $PWD = '/'
+    echo -n '/'
+  else
+    echo -n $PWD | grep -o -E '[^\/]+$'
+  end
 end
 
 function __toaster_git_status_codes
-- 
GitLab