Мы используем 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
🪐 Discovered in 2013, asteroid 2013 TX68 drew attention due to its unpredictable orbit, which allowed it to pass within a few million kilometers of Earth—close enough that its next flyby in 2046 will be closely watched. This space rock is roughly 30 meters wide, similar in size to the Chelyabinsk meteor, and while it's not currently on a collision course, its uncertain path highlights the challenges of tracking smaller, potentially hazardous asteroids. ✨
#asteroids⚡#nearearth⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 Asteroid (4660) Nereus is a near-Earth object about 330 meters wide, famous for its frequent close approaches to our planet due to its elongated orbit around the Sun. While it poses no immediate danger, Nereus occasionally comes within just a few million kilometers of Earth, making it one of the more closely watched space rocks for future planetary defense planning. ✨
#asteroids⚡#nearearth⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 Asteroid (29075) 1950 DA is one of the most closely monitored potentially hazardous asteroids, as it has a slim chance of impacting Earth in the year 2880. This kilometer-sized space rock spins so fast—completing a rotation every 2.1 hours—that its own gravity barely holds it together, making it a real cosmic oddity among dangerous near-Earth objects. ✨
#asteroids⚡#planetarydefense⚡#spacehazards⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The asteroid (410777) 2009 FD is a near-Earth object roughly 472 meters wide, with an orbit that brings it uncomfortably close to our planet every few decades. Although calculations show it poses no immediate threat, its path is closely watched because even moderate-sized objects like 2009 FD can cause widespread devastation if they ever collide with Earth. ✨
#asteroids⚡#planetarydefense⚡#nearearthobjects⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 In 2013, astronomers tracked asteroid (367943) Duende, a 30-meter-wide space rock that passed just 27,700 kilometers above Earth's surface—closer than many weather satellites. Duende’s near miss was remarkable not only for its proximity, but because it approached from the Sun’s direction, making it hard to spot in advance and highlighting the ongoing challenge of detecting small but potentially hazardous asteroids before they pass close to our planet. ✨
#asteroids⚡#duende⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The asteroid (2011) AG5, classified as a near-Earth object, made headlines because it once had the highest estimated probability of impacting Earth in the 21st century. Thanks to ongoing observations, scientists have refined its path, showing it will safely pass by our planet in 2040, but its close approach—just 1.1 million kilometers away—demonstrates how carefully even modest-sized asteroids must be tracked to protect Earth from unexpected cosmic threats. ✨
#asteroids⚡#nearearthspace⚡#planetarydefense⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries