Мы используем 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
🪐 The mysterious "dark flow" observed in the movement of galaxy clusters like Abell 3627 suggests that something unseen—possibly related to dark matter or dark energy—is pulling vast regions of the universe in the same direction. This large-scale motion, detected using X-rays from hot gas in clusters, remains unexplained by normal gravity and hints at the hidden forces shaping the cosmos beyond what we can directly observe. ✨
#darkmatter⚡#universe⚡#galaxyclusters⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 Deep in the Coma Cluster, a packed group of over 1,000 galaxies, astronomers have measured how dark energy—a mysterious force causing the universe to expand faster over time—stretches the space between galaxies. Observations show that the distance between massive galaxies in the Coma Cluster grows not just from their own motion, but because dark energy is steadily pushing the entire cosmic structure apart. ✨
#darkenergy⚡#galaxyclusters⚡#cosmology⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 The Bullet Cluster, found in the constellation Carina, provides some of the clearest real-world evidence for dark matter—a mysterious, invisible substance making up most of the universe’s mass. When two galaxy clusters crashed together, X-ray images showed that most of the visible matter stayed at the center, but gravity maps revealed most of the mass had moved ahead, proving something unseen—dark matter—was driving the collision's aftermath. ✨
#darkmatter⚡#galaxyclusters⚡#carina⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 The cosmic microwave background holds a hidden fingerprint—tiny temperature fluctuations mapped in exquisite detail by satellites like Planck reveal how the first stars and galaxies, such as those in the ancient cluster Abell 2744, grew from initial small ripples in the early universe. These faint variations, just millionths of a degree, became the seeds around which all the cosmic structures we see today first assembled. ✨
#cosmicmicrowavebackground⚡#earlyuniverse⚡#galaxyclusters⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The cosmic microwave background contains faint "Sunyaev-Zel’dovich effects," which happen when the ancient microwave light passes through hot gas in galaxy clusters like the Bullet Cluster. This process boosts the energy of some photons (light particles), leaving tiny shadows in the background glow—allowing astronomers to map both distant galaxy clusters and the hot plasma between galaxies by studying these subtle marks in the oldest light in the universe. ✨
#microwave⚡#background⚡#galaxyclusters⚡#plasma⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels