Мы используем 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
🌎 Hidden deep beneath the Yucatán Peninsula in Mexico, the Sistema Sac Actun is the world’s longest underwater cave system. Stretching over 370 kilometers, these flooded limestone tunnels were formed by rainwater dissolving rock over thousands of years. Archaeologists have found ancient human and animal fossils preserved in the caves, including remains over 13,000 years old. ✨
#caves⚡#archaeology⚡#fossils
👉subscribe Interesting Planet
👉more Channels
🌎 Horseshoe crabs have remained virtually unchanged for about 450 million years. Despite their name, they are more closely related to spiders than to true crabs. Modern horseshoe crabs can be found along the Atlantic coast of North America and in Southeast Asia. ✨
#animals⚡#evolution⚡#fossils
👉subscribe Interesting Planet
👉more Channels
🌎 Living fossils like the chambered nautilus and horseshoe crab have changed little for hundreds of millions of years. The nautilus dates back over 500 million years, and its closest extinct relatives include ammonites, which died out with the dinosaurs. ✨
#evolution⚡#fossils⚡#animals
👉subscribe Interesting Planet
👉more Channels
🌎 Living fossils like the giant freshwater stingray and the Australian lungfish have remained almost unchanged for over 100 million years, surviving dramatic changes in Earth’s environment. The horseshoe crab’s body plan is so ancient, it first appeared 450 million years ago. ✨
#evolution⚡#fossils⚡#animals
👉subscribe Interesting Planet
👉more Channels
🌎 Some ancient animals have survived unchanged for millions of years. The coelacanth, once thought extinct, first appeared 400 million years ago and still swims deep ocean waters today. The horseshoe crab dates back over 450 million years, predating dinosaurs and even trees. ✨
#evolution⚡#fossils⚡#animals
👉subscribe Interesting Planet
🌍 In Alaska, some permafrost soils have preserved ancient animal remains, like mammoth bones and fur, for tens of thousands of years—locked in ice until modern thaw reveals them. ✨
#permafrost⚡#tundra⚡#fossils⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Permafrost, ground that stays below freezing year-round, traps ancient plant and animal remains. Thawing permafrost in tundra regions is revealing fossils not seen for thousands of years. ✨
#permafrost⚡#tundra⚡#fossils⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌎 In the icy waters near Antarctica, the Antarctic feather star unfurls feathery arms up to 20 times its body length to catch drifting food. This ancient sea creature is a living fossil, unchanged for hundreds of millions of years. ✨
#ocean⚡#fossils⚡#wildlife
👉subscribe Interesting Planet
🌍 The White Cliffs of Dover are made of tiny sea fossils compressed over millions of years. Each cliff face erodes by about one centimeter per year as waves steadily wear them down. ✨
#coastline⚡#erosion⚡#fossils⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Mediterranean coastline holds more than 150 million-year-old fossils, often exposed in seaside cliffs by constant wave erosion. Some beach rocks here contain ancient traces of life dating back to the dinosaurs. ✨
#coastlines⚡#fossils⚡#erosion⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 Alligators are ancient survivors, having changed little in 80 million years. These reptiles outlived the dinosaurs and now inhabit wetlands in the Americas. ✨
#animals⚡#fossils⚡#reptiles
👉subscribe Interesting Planet
👉more Channels
🌎 An ancient “rainbow” mineral called ammolite forms from fossilized ammonite shells. With its dazzling reds, greens, and blues, ammolite is one of the world’s rarest gemstones, found mainly in Canada’s Rocky Mountains. ✨
#geology⚡#fossils⚡#gemstones
👉subscribe Interesting Planet