bmbferreira / travelgrunt

Travel Terragrunt directory tree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

travelgrunt

Travel Terragrunt directory tree as a first class passenger! ✈️

How to use?

  • cd to the directory of your [locally cloned] Terragrunt/Terraform Git repo;
  • run tg alias there 🚀 ([optional] arguments are "path filter" matches);
  • use arrow keys to navigate the list and / key to search for specific items;

Shell aliases

It is absolutely required to use bash (or zsh) aliases. Start from something like this:

alias tg='_tg(){ travelgrunt -out-file ~/.tg-path ${@} && cd "$(cat ~/.tg-path)" }; _tg'
alias tt='_tt(){ travelgrunt -top -out-file ~/.tg-path && cd "$(cat ~/.tg-path)" }; _tt'

💡 tt is a "convenience alias" that brings you to the top level path of your repository.

Why aliases?

Core feature of this program is the ability to change working directory while staying inside the current shell. This can not be done by the program itself, because of POSIX security limitations. Without instrumenting the shell with aliases travelgrunt will not work!

How to install?

Install latest release binary into /usr/local/bin (default):

curl -s -f \
  https://raw.githubusercontent.com/ivanilves/travelgrunt/main/scripts/install-latest.sh | sh

Install latest release binary into /somewhere/else/bin:

curl -s -f \
  https://raw.githubusercontent.com/ivanilves/travelgrunt/main/scripts/install-latest.sh \
  | PREFIX=/somewhere/else sh

How to build?

  • make dep - install/ensure dependencies;
  • make build - build the travelgrunt binary in cmd/travelgrunt path;
  • make install - [optional] install built travelgrunt binary under the ${PREFIX}/bin location;

How to release a new version? 📦

About

Travel Terragrunt directory tree

License:Apache License 2.0


Languages

Language:Go 61.0%Language:Makefile 11.8%Language:HCL 10.7%Language:Shell 9.8%Language:Ruby 6.6%