Мы используем Makefile думая, что нет альтернатив, что это стандарт и всё такое.
Но make это не запускалка команд, а система сборки. Мы фактически используем его не по назначению.
И на самом деле альтернатива есть! Некоторое время назад я открыл для себя прекрасный инструмент - just. Он решает все проблемы make.
just - это не система сборки как make, это именно исполнитель команд!
Больше никаких Phony Targets и табуляций, привет нормальный синтаксис и передача аргументов!!! 😎
⭐️Что умеет just:
✅ Автодокументирование команд
Не нужно делать отдельную команду с докой, просто добавь комментарий
# команда сборки
build:
...
$ just --list
Available recipes:
build # команда сборки
Команда с именем default запускается по умолчанию если не указано другое, так что я обычно делаю так:
default:
just --list
Теперь просто выполняем just и получаем доку из текущего файла.
✅ Удобная работа с переменными окружения
# загрузить из .env
set dotenv-load
# глобальная переменная
export PYTHONPATH := "./src"
# переменная для команды
test $TESTUNG="true":
pytest
✅ Передача аргументов
build target:
@echo 'Build {{target}}...'
команда запуска
$ just build dev
# Build dev...
✅ Выбор интерпретатора прямо в команде
Пример с инлайн-скриптом на python:
system:
#!/usr/bin/env python3
import platform
print(platform.system())
Эта же функция позволит выполнить скрипт как одну команду вместо перезапуска шела для каждой строки
foo:
#!/usr/bin/env sh
for file in ls .; do
echo $file
done
✅ Выполнение команды в определенной директории. Можно указать как релятивный путь так и абсолютный
[working-directory: 'backend']
build:
docker compose build
Также можно задать рабочую директорию глобально
Там еще много интересного:
- поддержка функций
- автокомплиты и интеграции
- экспрешены
- алиасы команд
- группировка команд
- альтернативы команды под разные ОС
- импорт других just-файлов
- цветной вывод
- ... и другие штуковины!
Так что вперёд - ➡️ читать доку!
Репозиторий: ➡️https://github.com/casey/just
Статья: ➡️https://www.chicks.net/reference/file_formats/just/
ЗЫ. Кажется, на Makefile я уже не вернусь)
#tools
I sprayed her butt just a little with hand sanitizer because she keeps on biting wires on the desk.. I swear just a little 🥺 & she slowly sit there, lying down, with her eyes looking at me for a while until slowly falls asleep 🥺 she stopped biting the wires but I feel bad 🥺 Is she sad? or just tired? 🥺
#random#Henoa
@quietworld🍃
Today, a thought strucked me;
I love looking at cats especially high breed cat but I never wanted to buy and take care of high breed cat because I'm scared that I'm not able to take good care of it since high breed requires high maintenance.. So, I only wanted to take care of village cat, but then, I treat the village cat like high breed cat 😂
So.. why was I scared to adopt/buy high breed cat, right? I treat my village cat like royal anyway 😂
* currently waiting for my kitten to come back from home-based grooming service (waiting anxiously) *
I hope she comes back here safe 🥺😢
#thoughts#cat#Henoa
@quietworld🍃
Yeyy she's finally back from grooming 😍 Her nails clipped, ears cleaned and she smells good ☺❤ I'll get no more scars because her habit of climbing me 🤣 for now.. until her nails grow long and sharp again 🤣
Worth the wait..
from 12:30PM until 03:40PM🥰
#cat#Henoa#chupdate
@quietworld🍃
Shopping for Henoa le Kitten again! 😍
Unplanned but I found item that I didn't know exist before that I think Henoa & I needs and I read lots of reviews saying that this shop sells a lot cheaper than other stores so why not? 😂
Will be making a video of unboxing these + review once they arrived and tested 🥰💞
Stay tuned for this video upload in my channel 🥰
#marcegetaway#youtube#kitten#Henoa
@quietworld🍃
New video uploaded! 😍
p/s: not the video I mentioned in my sneak peek post recently, that is still in the making😉
#adoptingastraykittenjourney#adoptdontshop#Henoa#kitten#youtube#chupdate
@quietworld🌻
New video uploaded! 😍
p/s: not the video I mentioned in my sneak peek post recently, that is still in the making😉
#shopee#haul#Henoa#kitten#youtube#chupdate
@quietworld🌻