From 8aaa911e199c2cf579bc502d467abe59b8089cb5 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sat, 26 Feb 2022 13:18:03 +0200 Subject: [PATCH] Add docker-compose TOML function --- dotdrop | 2 +- home/.config/zsh/03-aliases.zsh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dotdrop b/dotdrop index b1b4839e..8c97593c 160000 --- a/dotdrop +++ b/dotdrop @@ -1 +1 @@ -Subproject commit b1b4839ef391c1503bcaef03d89161348d074ac6 +Subproject commit 8c97593c45fc86ad7791707a3c8fab137180d4fa diff --git a/home/.config/zsh/03-aliases.zsh b/home/.config/zsh/03-aliases.zsh index 81ed6882..6fc2d25a 100644 --- a/home/.config/zsh/03-aliases.zsh +++ b/home/.config/zsh/03-aliases.zsh @@ -238,3 +238,22 @@ btw, () { ▟███▀▘ ▝▀███▙ ▟▛▀ ▀▜▙" } + +# docker-compose with TOML +dct() { + local file_path=('./docker-compose.toml') + + zmodload zsh/zutil + zparseopts -D -K -- \ + f:=file_path || + return 1 + + file_path=${file_path[-1]} + + if [[ ! -a "$file_path" ]]; then + echo "File $file_path does not exist!" + return 1 + fi + + yj -ty < $file_path | docker-compose -f - $@ +}