Мы используем 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 exoplanet TRAPPIST-1c, located about 40 light-years away, is a rocky world baked by its star to temperatures hot enough to melt lead—around 230°C—despite being only slightly larger than Earth. With a tight orbit of just 2.4 days, TRAPPIST-1c endures constant stellar radiation, making its surface a realm of extreme heat and intense space weather unlike anything found on our planet. ✨
#exoplanets⚡#extremes⚡#TRAPPIST1⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 In 2017, astronomers discovered a group of odd, repeating radio signals coming from TRAPPIST-1, an ultracool dwarf star with seven Earth-sized exoplanets just 39 light-years away. While these signals turned out to be natural phenomena related to the star's magnetic activity, TRAPPIST-1 remains one of the most intriguing targets in the search for alien life because several of its planets orbit in the habitable zone, where liquid water could exist. ✨
#aliens⚡#exoplanets⚡#trappist1⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 The James Webb Space Telescope has discovered that the exoplanet TRAPPIST-1b, one of seven planets orbiting the star TRAPPIST-1 about 41 light-years away, has no detectable atmosphere. Webb’s sensitive instruments showed that the planet’s dayside is hotter than expected if it had an atmospheric blanket, suggesting its surface is bare rock—shaping new ideas about the harsh conditions on close-orbiting worlds around small stars. ✨
#exoplanets⚡#trappist1⚡#webb⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 In the TRAPPIST-1 system, about 40 light-years away, seven Earth-sized exoplanets orbit a cool, dim star, and at least three of them lie in the star’s “habitable zone”—the region where temperatures might allow liquid water to exist on their surfaces. This cluster of small worlds makes TRAPPIST-1 one of the top real candidates in the search for places where life could exist beyond our solar system. ✨
#TRAPPIST1⚡#exoplanets⚡#habitable⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels