Мы используем 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 biosphere reaches from deep ocean trenches to high mountain peaks, supporting life almost everywhere—even microbes live in extreme environments far below Earth's surface or high in the clouds. ✨
#biosphere⚡#lithosphere⚡#atmosphere⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The biosphere is found in surprising places—microbes thrive in clouds high in the atmosphere and deep within the lithosphere’s rocks, connecting all Earth’s spheres in unexpected ways. ✨
#biosphere⚡#lithosphere⚡#atmosphere⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The biosphere, which includes all living things, only extends a few kilometers into the air and oceans. Most life on Earth is packed into a surprisingly thin layer near the surface. ✨
#biosphere⚡#earth⚡#layers⚡#geography⚡#nature
👉subscribe Amazing Geography🌍
🌍 The hydrosphere holds less than 0.01% of Earth's water in rivers and lakes, while most is locked in glaciers, ice caps, or underground. These hidden reserves link all of Earth’s spheres. ✨
#hydrosphere⚡#lithosphere⚡#biosphere⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The deepest part of the ocean, the Mariana Trench, reaches nearly 11,000 meters below sea level. Here, the hydrosphere, lithosphere, and biosphere all meet in extreme conditions. ✨
#hydrosphere⚡#lithosphere⚡#biosphere⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The deepest point on land, the Dead Sea Depression, lies about 430 meters below sea level, linking the lithosphere, atmosphere, hydrosphere, and biosphere in an extreme environment for life. ✨
#lithosphere⚡#hydrosphere⚡#biosphere⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Some bacteria and fungi live deep in rocks of the lithosphere, far below where sunlight reaches. These life forms connect the biosphere to Earth's rocky layer in ways once thought impossible. ✨
#lithosphere⚡#biosphere⚡#microbes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Earth’s spheres aren’t fixed—they overlap at microbe level. Extremophiles, tiny life forms, live deep underground rocks, linking the biosphere to the lithosphere in some of Earth's harshest zones. ✨
#lithosphere⚡#biosphere⚡#microbes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍