Мы используем 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
A gold coin found in 1713 in Transylvania is likely genuine. The coin shows a Roman ruler named Sponsian, who was long believed to be fictional. Tests found real ancient wear and soil deposits, suggesting he was a real leader during the 3rd-century Roman crisis.
🪙🏛️
[Read more]
@googlefactss
#history#ancientrome#archaeology#facts
Flexible glass was a legendary type of glass from ancient Rome. A craftsman is said to have invented it, and it could supposedly bend without breaking. He showed it to Emperor Tiberius, who reportedly asked him to confirm he was the only one who knew how to make it. The emperor then had him executed to prevent the invention from spreading, an early example of planned obsolescence. No known examples survive today.
🏺🪞📜
[Read more]
@googlefactss
#FlexibleGlass#AncientRome#History#Legends#Innovation
The Ancient Romans put toast in their wine because they believed it was good for health. This is where the tradition of "raising a toast" comes from. 🍷🍞
[Read more]
@googlefactss🍷🍞#AncientRome#Toast#Wine#History#Tradition
The Battle of Munda was fought on 17 March 45 BC in southern Hispania. Julius Caesar faced the last Pompeian army led by Gnaeus Pompeius, Sextus Pompeius, and Titus Labienus. The Pompeians held high ground. After hours of heavy fighting, Caesar’s army won. Around 30,000 Pompeians were killed. The victory ended major resistance to Caesar in the Roman civil war.
⚔️🏛️
[Read more]
@googlefactss
#history#romanempire#ancientrome#juliuscaesar#historyfacts#war
Saturnalia was an ancient Roman festival from December 17th to 23rd honoring Saturn, god of agriculture and time. During this time, social rules changed: slaves ate with masters, a "King of Saturnalia" was chosen, and people exchanged gifts like candles and figurines. The city was full of feasting, gambling, and candlelight. Many Saturnalia traditions influenced modern Christmas celebrations.
🏛️🎭🕯️🎄🎁
[Source1] [Source2]
@googlefactss
#Saturnalia#RomanHistory#ChristmasOrigins#WinterSolstice#AncientRome#History