Мы используем 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
🌍 In some places, coastal cliffs are vanishing so quickly that entire villages have moved inland within a single generation, as sea level rise and stronger storms speed up the erosion. ✨
#erosion⚡#coastlines⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The boundary where the Earth's solid land meets the sea—called the coastline—is constantly changing. Waves, tides, and storms reshape these edges every day, making coastlines dynamic and ever-shifting. ✨
#geography⚡#coastlines⚡#change⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Coastal erosion is eating away cliffs and beaches so fast in some places that detailed maps need updating every year, with new shorelines appearing and disappearing before our eyes. ✨
#coastlines⚡#erosion⚡#mapping⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Coastal erosion now removes up to 24 square meters of land per meter of shoreline in some parts of West Africa each year, forcing whole fishing villages to move further inland. ✨
#coastlines⚡#erosion⚡#sea-level ⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Satellite data shows that some coastlines have retreated by over 50 meters in just a decade, as rising sea levels and stronger storms rapidly reshape shores across the globe. ✨
#erosion⚡#sea-level ⚡#coastlines⚡#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
🌍 Mangroves protect coastlines from storms and rising seas, but over a third have been lost worldwide. Their destruction leaves many regions more vulnerable to flooding and erosion. ✨
#mangroves⚡#coastlines⚡#erosion⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The Salar de Uyuni in Bolivia holds an ancient, dried-up sea that now forms the world's largest salt flat. Rare rainy seasons briefly transform it into a mirror reflecting the entire sky. ✨
#coastlines⚡#saltflat⚡#landscape⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Bohai Sea in China is so shallow that its average depth is just 18 meters—less than a six-story building. This makes it one of the least deep seas in the world’s coastal regions. ✨
#seas⚡#coastlines⚡#shallow⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels