Мы используем 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
🌍 Tropical peat swamp forests store massive amounts of carbon in deep, soggy soils. Some areas in Southeast Asia hold peat deposits over 10 meters thick, locking away centuries of trapped carbon. ✨
#rainforest⚡#carbon⚡#wetlands⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some freshwater wetlands and deltas trap so much carbon in their soil that, hectare for hectare, they store more than most forests—making them powerful natural climate regulators. ✨
#wetlands⚡#delta⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Arctic tundra’s permafrost acts like a giant freezer, locking away twice as much carbon as all the world’s forests combined, making it a crucial regulator for Earth’s climate. ✨
#permafrost⚡#tundra⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The global carbon cycle constantly moves carbon between the air, land, water, and living things. This cycle helps regulate Earth’s climate by storing and releasing carbon dioxide. ✨
#carbon⚡#climate⚡#cycles⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Canada holds more than 30% of the world’s forests, making it the top country for natural forest area. These forests store massive amounts of carbon and water—critical global natural resources. ✨
#resources⚡#forests⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
Grand Power кобура скрытого ношения на быстросъёмных крепежах с мягким слоем Alcantara внутри.
Двойной подсумок
Кобура скрытого ношения с Alcantara, с дополнительным магазином.
➡️#grandpower
➡️#моноблок
➡️#carbon
НЕ ПРОДАЖА ОРУЖИЯ! ⚠️
Демонстрируется только для наглядности функционала.
По вопросам заказа связывайтесь с нами📱
ПОДПИСЫВАЙТЕСЬ ЧТО БЫ НЕ ТЕРЯТЬСЯ:
📱MAX
📱VK
@DP_KH
🌍 Some grassland soils are so fertile they can support crops for decades without added fertilizer. These deep, dark soils store huge amounts of carbon, helping stabilize the global climate. ✨
#grasslands⚡#soil⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Argentina’s Pampas are vast temperate grasslands that grow some of the world’s richest soils. These grasslands support massive cattle herds and store huge amounts of carbon underground. ✨
#grasslands⚡#pampas⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels