https://pulumi.com logo
#general
Title
# general
s

salmon-account-74572

03/24/2020, 4:21 PM
Wish list item: A segment for
powerline-go
(https://github.com/justjanne/powerline-go/) that shows the currently selected Pulumi stack in my Powerline prompt. ๐Ÿ™‚
๐Ÿ‘ 1
g

green-morning-1318

03/24/2020, 4:48 PM
I like that ideaโ€ฆ so I just created one ๐Ÿ˜‚ you can add this snippet to your .zshrc
Copy code
POWERLEVEL9K_CUSTOM_PULUMI_STACK="zsh_pulumi_stack"
POWERLEVEL9K_CUSTOM_PULUMI_STACK_BACKGROUND="blue"
POWERLEVEL9K_CUSTOM_PULUMI_STACK_FOREGROUND="black"

zsh_pulumi_stack(){
  if test -f "Pulumi.yaml"; then
    local stackname=$(pulumi stack | grep "Current stack is" | sed 's/://g' | sed 's/Current stack is//g')
    echo -n "%F{black}Stack: $stackname"
  fi
}
You can add it to your prompt elements with
custom_pulumi_stack
s

salmon-account-74572

03/24/2020, 4:50 PM
Neat! Unfortunately, I don't use
zsh
. ๐Ÿ™‚
g

green-morning-1318

03/24/2020, 4:51 PM
darn ๐Ÿ˜‚
which one do you use?
s

salmon-account-74572

03/24/2020, 4:51 PM
I'm a
bash
guy.
g

green-morning-1318

03/24/2020, 4:53 PM
Ok, coolโ€ฆ not making any promises but Iโ€™ll look at it ๐Ÿ™‚
s

salmon-account-74572

03/24/2020, 4:54 PM
Before you do that...
powerline-go
is actually written in Go, so maybe don't bother with Bash? ๐Ÿ™‚
g

green-morning-1318

03/24/2020, 4:58 PM
That should workโ€ฆ I do like Go ๐Ÿ˜‡
s

salmon-account-74572

03/24/2020, 5:00 PM
So I've heard ๐Ÿ˜„
g

green-morning-1318

03/24/2020, 5:19 PM
I just realized we actually work at the same company ๐Ÿ˜‚
s

salmon-account-74572

03/24/2020, 5:23 PM
LOL, I'd never bothered to look "behind" the username. How funny! ๐Ÿ‘‹๐Ÿป
๐Ÿ‘‹ 1
b

billowy-army-68599

03/24/2020, 5:59 PM
I was going to make a zsh plugin
looks like someone got ahead of me!
s

salmon-account-74572

03/24/2020, 6:01 PM
Indeed ๐Ÿ™‚