Skip to content
Snippets Groups Projects
Commit c82f3dec authored by nimrod's avatar nimrod
Browse files

Small fix to tf-next.

parent af3ac763
No related branches found
No related tags found
No related merge requests found
...@@ -13,5 +13,10 @@ alias tfvf='tf init -backend=false && tf validate && tf fmt -diff' ...@@ -13,5 +13,10 @@ alias tfvf='tf init -backend=false && tf validate && tf fmt -diff'
tf-next () { tf-next () {
current="$(tf workspace show)" current="$(tf workspace show)"
next="$(tf workspace list | cut -c3- | grep --line-regexp --after-context=1 "$current" | tail +2)" next="$(tf workspace list | cut -c3- | grep --line-regexp --after-context=1 "$current" | tail +2)"
if [ -z "${next}" ]
then
red "Last workspace."
return
fi
tf workspace select "$next" tf workspace select "$next"
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment