Мы используем 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
🌎 Lurking in deep space, “dark matter” makes up about 27% of the universe, yet it remains invisible. Scientists infer its existence by observing gravity’s effects—like stars swirling faster than visible matter alone predicts. Its true nature is still unknown, but it outweighs all regular matter combined. ✨
#space⚡#astrophysics⚡#mystery
👉subscribe Interesting Planet
🌎 Mysterious dark matter makes up about 27% of the universe, but it does not emit or absorb light, making it invisible. Scientists detect dark matter only through its gravitational effects on galaxies and galaxy clusters. The leading candidates for dark matter particles are called WIMPs—Weakly Interacting Massive Particles. ✨
#space⚡#universe⚡#astrophysics
👉subscribe Interesting Planet
👉more Channels
🌎 Gamma-ray bursts are the most energetic explosions in the universe, releasing in seconds as much energy as the Sun emits over its entire 10-billion-year lifespan. They are detected by satellites as brief flashes of gamma radiation, and are thought to result from collapsing massive stars or merging neutron stars. ✨
#space⚡#gamma⚡#astrophysics
👉subscribe Interesting Planet
👉more Channels
🪐 In the spiral galaxy NGC 4993, scientists observed a gamma-ray burst, GRB 170817A, that arrived just 1.7 seconds after gravitational waves from the merger of two neutron stars—ultra-dense stellar remnants. This remarkable event marked the first time both gravitational waves and a gamma-ray burst were detected from the same source, giving astronomers an unprecedented, multi-messenger view of a cosmic collision. ✨
#gamma⚡#astrophysics⚡#neutronstars⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 In 2022, the Event Horizon Telescope captured the first radio image of the supermassive black hole at the center of our galaxy, Sagittarius A*, revealing a glowing ring of hot gas swirling around the event horizon—the point beyond which nothing can escape. This image confirmed decades of theory about black holes and showed that matter falling in forms a bright, lopsided halo just outside the black hole’s shadow, unlocking new clues about how these cosmic giants really behave. ✨
#blackholes⚡#SagittariusA⚡#astrophysics⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The star HE 0107-5240, found in the constellation Phoenix, is one of the most metal-poor stars ever discovered, meaning it contains almost no elements heavier than hydrogen and helium. This rare "primordial" star likely formed from the material left over after the very first stars died, making it an ancient relic that helps scientists study the universe's earliest generations of stars. ✨
#unusualstars⚡#primordialstars⚡#astrophysics⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The spiral galaxy Messier 83 has hosted more recorded gamma-ray bursts than almost any spiral galaxy nearby, becoming a hotspot for these mysterious explosions. Gamma-ray bursts are split-second flashes of the universe’s most energetic light, and their frequent appearance in Messier 83 helps scientists study how massive stars can end their lives in extreme, spectacular fashion. ✨
#Messier83⚡#gamma⚡#astrophysics⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The pulsar PSR J0437−4715, located about 500 light-years away in the constellation Pictor, spins nearly 174 times per second and is famous for its near-perfect "cosmic clock" precision. This ultra-stable pulsar allows astronomers to test the fundamental laws of physics and even hunt for elusive gravitational waves by tracking the tiny variations in its radio pulses over many years. ✨
#pulsars⚡#Pictor⚡#astrophysics⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
What If The Universe DID NOT Start With The Big Bang?
@PBS Space Time
👉 Head to https://brilliant.org/spacetime/ for a 30-day free trial + 20% off your annual subscription
#YouTube#liked#Black_Holes#Black_Hole#Black_Hole_Physics#Space#Outer_Space#Physics#Astrophysics#Quantum_Mechanics#Space_Physics#PBS#Space_Time#Time#PBS_Space_Time#Matt_O_Dowd#Einstein#Einsteinian_Physics#General_Relativity#Special_Relativity#Dark_Energy#Dark_Matter#The_Universe#Math#Science_Fiction#Calculus#Maths#Holographic_Universe#Holographic_Principle#Rare_Earth#Anthropic_Principle#Weak_Anthropic_Principle#Strong_Anthropic_Principle