Мы используем 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
The custom of putting candles on cakes dates back to the ancient Greeks, who honored the goddess Artemis by placing lit candles on round, moon-shaped cakes. They believed that the smoke from the candles carried their wishes and prayers up to the gods in the sky.
@googlefactss#history#ancientgreece
The name Ethiopia comes from the ancient Greek word “Aithiopia.” It comes from “aithō” (to burn) and “ops” (face), meaning “burnt face.” Ancient Greeks used this word to describe dark-skinned people living south of Egypt. The word appears in the works of Homer, who lived around the 8th century BCE. 🌍🔥
#Ethiopia#History#AncientGreece#DidYouKnow@googlefactss
In ancient Greece, rhaphanidosis was a documented punishment for adultery 📜. Those convicted would have a radish root inserted into their anus as both physical penalty and public shaming .
[Source] 🍑🥕
@googlefactss#AncientGreece#History#HistoricalFacts#Vegetables
The first vending machine was invented in the 1st century AD by Greek engineer Heron of Alexandria. It dispensed holy water when a coin was inserted—the weight tilted a lever, opening a valve to release water before the coin dropped. 💧⚖️
[Learn more]
@googlefactss
#History#Inventions#Engineering#AncientGreece
🌍 Over 2,200 years ago, the Greek mathematician Eratosthenes calculated Earth’s circumference using only a stick and his brain — and he was almost exactly right! 📏
By observing shadows in two cities, he calculated the Earth was about 40,000 km around. Ancient genius at its finest!
[Source]
@googlefactss#AncientGreece#ScienceHistory#Eratosthenes#EarthCircumference#AncientScience
In ancient Athens, some elite men formed socially recognized relationships with adolescent boys called eromenos. The adult, erastes, acted as a mentor, teaching the boy skills and introducing him to society. These relationships were accepted at the time and had strict social rules: the boy had to be young and not fully grown. Once he reached adulthood, remaining in that role was considered inappropriate..
🏛️📜
@googlefactss#AncientGreece#History#Athens#Culture#Mentorship#Elite#law