Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ansi colors as baked in variables #1645

Closed
dionjwa opened this issue Jul 15, 2023 · 1 comment
Closed

Add ansi colors as baked in variables #1645

dionjwa opened this issue Jul 15, 2023 · 1 comment

Comments

@dionjwa
Copy link

dionjwa commented Jul 15, 2023

I add this to all my justfiles, so perhaps something that could be baked in:

bold                               := '\033[1m'
normal                             := '\033[0m'
green                              := "\\e[32m"
yellow                             := "\\e[33m"
blue                               := "\\e[34m"
magenta                            := "\\e[35m"
grey                               := "\\e[90m"

So I can

echo -e "{{green}} something here! {{normal}}"
   

in different places. It's a lot of repeated preamble in the justfile.

Maybe there is a better way to do this?

@casey
Copy link
Owner

casey commented Oct 9, 2023

Maybe a function or functions would be better, since just doesn't have a concept of global, default variables. If there's one function, it could be color("green") and color("none").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants