tide (fish prompt) installed
This commit is contained in:
parent
142fd7eaa4
commit
e83440486a
85 changed files with 2589 additions and 62 deletions
19
.config/fish/functions/_tide_item_pulumi.fish
Normal file
19
.config/fish/functions/_tide_item_pulumi.fish
Normal file
|
@ -0,0 +1,19 @@
|
|||
function _tide_item_pulumi
|
||||
if path filter $_tide_parent_dirs/Pulumi.yaml | read -l yaml_path
|
||||
if command -q sha1sum
|
||||
echo -n "$yaml_path" | sha1sum | string match -qr "(?<path_hash>.{40})"
|
||||
else if command -q shasum
|
||||
echo -n "$yaml_path" | shasum | string match -qr "(?<path_hash>.{40})"
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
string match -qr 'name: *(?<project_name>.*)' <$yaml_path
|
||||
set -l workspace_file "$HOME/.pulumi/workspaces/$project_name-$path_hash-workspace.json"
|
||||
|
||||
if test -e $workspace_file
|
||||
string match -qr '"stack": *"(?<stack>.*)"' <$workspace_file
|
||||
_tide_print_item pulumi $tide_pulumi_icon' ' $stack
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue