mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-19 21:27:28 +03:00
0a83ef6af8
* Add Pulumi support * Fix indentation issues * Update to command rm in pulumi test * Replace python script with sha1sum command; Update to use fish builtins * Some changes to pulumi item * Update pulumi item for search-up behavior * Actually update pulumi item for search-up behavior * Merge main Co-authored-by: Ilan Cosman <ilancosman@gmail.com>
20 lines
779 B
Fish
20 lines
779 B
Fish
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 sub -e40 | read -f path_hash
|
|
else if command -q shasum
|
|
echo -n "$yaml_path" | shasum | string sub -e40 | read -f path_hash
|
|
end
|
|
|
|
if test -n "$path_hash"
|
|
string match -rg 'name: *(.*)' <$yaml_path | read -l project_name
|
|
set -l workspace_file "$HOME/.pulumi/workspaces/$project_name-$path_hash-workspace.json"
|
|
|
|
if test -e $workspace_file
|
|
string match -rg '"stack": *"(.*)"' <$workspace_file | read -l stack
|
|
_tide_print_item pulumi $tide_pulumi_icon' ' $stack
|
|
end
|
|
end
|
|
end
|
|
end
|