Мы используем 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
Thiago Alcántara ha decidido retirarse del fútbol profesional.
El exjugador de Barça, Bayern, Liverpool y España ha tomado su decisión.
La pasión y el amor de Thiago por el juego continúan mientras está listo para un nuevo capítulo en el fútbol después de algunos meses de planificación.
📱: Fabrizio Romano
@Fut_Planet⚜️#Thiago⚽️
Lara, speaking from Brazil, has had no contact with her husband, Thiago Ávila, since he was abducted and detained illegally by Israeli forces from the 'Madleen'. Since then, Thiago has been placed in solitary confinement, denied communication with his family.
According to Lara, Israeli authorities threatened Thiago with the psychological torment of isolation without light or ventilation. Despite this, Thiago remains on hunger strike, holding firm to his belief in justice for Palestinians and the right of every child to food, safety, and freedom.
From his prison cell, he wrote a letter to his 1-year-old daughter. Lara generously shares that with us today.
This is a call not just for Thiago’s release—but for the world to pay attention to Gaza, to Palestine, and to all people who are exploited, forced to live under occupation.
#FreedomFlotilla#Madleen#Thiago#IOF#WeWillSail#BreakIsraelsSiege#EndTheBlockade
"Families of Gaza are not less important than my family. It’s by mere chance that we are not one of those families that are in Gaza right now."
Thiago Ávila, father and activist aboard 'Handala', will sail towards Gaza with an urgent mission: to break the illegal siege and stand with the children of Gaza. 'Handala' is a small boat, but it carries the weight of a global uprising for justice. As catastrophic famine unfolds across Gaza, evidence of heinous sexual and physical violence by the IOF continues to emerge, and the Israeli and U.S.-backed genocide persists with impunity, people power is more integral than ever—it’s up to us to shape a new society.
The world must not turn its eyes away. Keep your eyes on 'Handala'. Share our mission, amplify Palestinian voices, and do everything you can to stand for Gaza. The flood of change is coming—be part of it. #FreedomFlotilla#Handala#FreePalestine#Gaza#AllEyesOnDeck#FreeGaza#WeWillSail#Thiago#Brazil#HumanRights#Genocide#IOF