Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
0ab87c26
Unverified
Commit
0ab87c26
authored
Mar 08, 2021
by
Vlad Korolev
Committed by
GitHub
Mar 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(terraform): use faster method to get workspace (#9709)
Also add tf_prompt_info to the list of prompt functions so theme writers are aware of it
parent
6fbad5bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
prompt_info_functions.zsh
lib/prompt_info_functions.zsh
+1
-0
terraform.plugin.zsh
plugins/terraform/terraform.plugin.zsh
+2
-2
No files found.
lib/prompt_info_functions.zsh
View file @
0ab87c26
...
@@ -18,6 +18,7 @@ function chruby_prompt_info \
...
@@ -18,6 +18,7 @@ function chruby_prompt_info \
vi_mode_prompt_info
\
vi_mode_prompt_info
\
virtualenv_prompt_info
\
virtualenv_prompt_info
\
jenv_prompt_info
\
jenv_prompt_info
\
tf_prompt_info
\
{
{
return
1
return
1
}
}
...
...
plugins/terraform/terraform.plugin.zsh
View file @
0ab87c26
...
@@ -2,8 +2,8 @@ function tf_prompt_info() {
...
@@ -2,8 +2,8 @@ function tf_prompt_info() {
# dont show 'default' workspace in home dir
# dont show 'default' workspace in home dir
[[
"
$PWD
"
==
~
]]
&&
return
[[
"
$PWD
"
==
~
]]
&&
return
# check if in terraform dir
# check if in terraform dir
if
[
-d
.terraform
]
;
then
if
[
[
-d
.terraform
&&
-r
.terraform/environment
]
]
;
then
workspace
=
$(
terraform workspace show 2> /dev/null
)
||
return
workspace
=
$(
cat
.terraform/environment
)
||
return
echo
"[
${
workspace
}
]"
echo
"[
${
workspace
}
]"
fi
fi
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment