Мы используем 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
🌎 Symbiosis between clownfish and sea anemones is a classic example of cooperation in nature. Clownfish live among anemone tentacles for protection, while their movements help ventilate and clean the anemone. Clownfish secrete mucus that prevents the anemone’s stings from harming them. ✨
#biology⚡#oceans⚡#animals
👉subscribe Interesting Planet
👉more Channels
🌎 Ocean-based carbon removal technologies are being piloted to fight climate change. Examples include spreading crushed minerals in seawater or using seaweed farms to absorb CO2. One experiment off Canada’s coast aims to capture and store up to 20,000 tons of CO2 per year. ✨
#climate⚡#oceans⚡#technology
👉subscribe Interesting Planet
👉more Channels
🌎 Box jellyfish, found in tropical oceans, have venom so deadly it can stop a human heart within minutes. Their nearly invisible tentacles can reach up to 3 meters long and are packed with thousands of stinging cells. ✨
#animals⚡#venom⚡#oceans
👉subscribe Interesting Planet
🌍 Asia is the largest continent, but the Pacific Ocean is even bigger—its area almost doubles that of all land in Asia, making it Earth’s vastest single geographic feature. ✨
#continents⚡#oceans⚡#earth⚡#geography⚡#nature
👉subscribe Amazing Geography
👉more Channels
🌍 The Pacific Ocean is wider than the entire Moon. At its widest, it stretches over 19,000 kilometers from Asia to the Americas—more than the Moon’s diameter of 3,474 kilometers. ✨
#continents⚡#oceans⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Earth’s surface area is about 510 million square kilometers—more than 70% is covered by oceans, making our home a true water planet among the rocky worlds of our Solar System. ✨
#Earth⚡#oceans⚡#planet⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The Southern Ocean, officially recognized in 2021, surrounds Antarctica and connects the Atlantic, Pacific, and Indian Oceans, forming a unique ring of cold currents that help regulate Earth’s climate. ✨
#continents⚡#oceans⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Earth’s mountain-building processes are still active—over 80% of volcanoes erupt near tectonic plate boundaries, constantly creating new land and even islands in the world’s oceans. ✨
#geology⚡#volcanoes⚡#oceans⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Atlantic Ocean is growing wider each year as the Americas slowly drift apart from Europe and Africa, adding about 2.5 centimeters annually—roughly the speed fingernails grow. ✨
#continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Eurasian and North American continents are moving apart by about 2.5 centimeters every year along the Mid-Atlantic Ridge, slowly widening the Atlantic Ocean over millions of years. ✨
#continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Antarctica is the only continent entirely surrounded by ocean and is nearly twice the size of Australia. Its thick ice reflects sunlight, helping regulate Earth’s overall temperature. ✨
#continents⚡#oceans⚡#Antarctica⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Salt marshes along coastlines act as natural buffers, soaking up floodwaters and trapping sediment. These unique habitats store carbon more efficiently than most forests. ✨
#coastline⚡#wetlands⚡#oceans⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍