Posts tagged: just

All posts with the tag "just"

5 posts latest post 2025-02-17
Publishing rhythm
Feb 2025 | 2 posts

Testing fresh nvim installs can be a pain, and hard to di without borking your known good install. I’ve been using NVIM_APPNAME to run a test nvim in a sandbox that wont bork my main install. This usually runs for me in under a minute, can be down under 15s if I remove some of the TreeSitter installs at the end. This beats a full docker build of my full devtainer to test out nvim packaging woes.

rm ~/.cache/wwtest -rf rm ~/.local/share/wwtest -rf rm ~/.config/wwtest -rf cp -r nvim/.config/nvim/ ~/.config/wwtest NVIM_APPNAME=wwtest nvim --headless "+Lazy sync" +qa NVIM_APPNAME=wwtest nvim --headless "+TSUpdateSync" "+sleep 5000m" +qa NVIM_APPNAME=wwtest nvim --headless "+MasonUpdate" +qa NVIM_APPNAME=wwtest nvim --headless "+TSInstallSync! c cpp go lua python rust tsx javascript typescript vimdoc vim bash yaml toml vue just" +qa NVIM_APPNAME=wwtest nvim --headless "+MasonInstall lua-language-server rustywind ruff ruff-lsp html-lsp typescript-language-server beautysh fixjson isort markdownlint stylua yamlfmt python-lsp-server" +qa NVIM_APPNAME=wwtest nvim

I’ve started to use this as a...

I found this nugget in thechangelogs justfile, it lets you add color to your justfile with variables quite easily.

# https://linux.101hacks.com/ps1-examples/prompt-color-using-tput/ _BOLD := "$(tput bold)" _RESET := "$(tput sgr0)" _BLACK := "$(tput bold)$(tput setaf 0)" _RED := "$(tput bold)$(tput setaf 1)" _GREEN := "$(tput bold)$(tput setaf 2)" _YELLOW := "$(tput bold)$(tput setaf 3)" _BLUE := "$(tput bold)$(tput setaf 4)" _MAGENTA := "$(tput bold)$(tput setaf 5)" _CYAN := "$(tput bold)$(tput setaf 6)" _WHITE := "$(tput bold)$(tput setaf 7)" _BLACKB := "$(tput bold)$(tput setab 0)" _REDB := "$(tput setab 1)$(tput setaf 0)" _GREENB := "$(tput setab 2)$(tput setaf 0)" _YELLOWB := "$(tput setab 3)$(tput setaf 0)" _BLUEB := "$(tput setab 4)$(tput setaf 0)" _MAGENTAB := "$(tput setab 5)$(tput setaf 0)" _CYANB := "$(tput setab 6)$(tput setaf 0)" _WHITEB := "$(tput setab 7)$(tput setaf 0)"

Usage

When using justfiles each line is ran separately from the last, unless you specify the file to be ran by something other than just such as bash. If you want variables to persist you need to set a shebang.

Also if you are using your script i a way that you want it to exit when it fails you need to set -e and -o pipefail. This is critical if you are thinking about using just for production scripts like ci/cd. I’ve hit too bugs where ci passes, but no artifacts were created issues for this exact reason.