From 24ae1d2c7c981bfa7f66d700c77d0df7657d9757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Thu, 18 Feb 2021 21:00:13 +0100 Subject: [PATCH] show workspace name --- fish/functions/fish_prompt.fish | 5 ++++- test/run_test | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish index 758b789..88670d8 100644 --- a/fish/functions/fish_prompt.fish +++ b/fish/functions/fish_prompt.fish @@ -3,7 +3,10 @@ function fish_prompt set -l host (hostname -s) if set -q DEVCONTAINER - set host DEV + set host (ls /workspaces | head -n 1) + if test -z "$host" + set host DEV + end end set_color (echo "$host" | md5sum | cut -c-6) echo -sn $host diff --git a/test/run_test b/test/run_test index 8b3c6dc..f80e5eb 100755 --- a/test/run_test +++ b/test/run_test @@ -4,6 +4,6 @@ cd "$(dirname "$0")/.." docker build . -t dotfiles -f test/Dockerfile --force-rm -docker run --rm -it dotfiles zsh +docker run --rm -it -v $(pwd):/workspaces/test dotfiles zsh docker rmi dotfiles \ No newline at end of file