Мы используем 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 discovery of the electron in 1897 by J.J. Thomson at Cambridge University revealed that atoms contain tiny negatively charged particles. This finding laid the foundation for modern electronics and atomic models. Thomson’s experiments used a cathode ray tube to prove electrons are much smaller than atoms. ✨
#discoveries⚡#physics⚡#history
👉subscribe Interesting Planet
👉more Channels
🪐 The James Webb Space Telescope has discovered powerful winds blowing from the supermassive black hole in the galaxy NGC 3783, located about 135 million light-years away. Using infrared observations, Webb revealed layers of hot, ionized gas speeding outward, showing how black holes can influence entire galaxies by blasting material across space with far-reaching cosmic outflows. ✨
#blackholes⚡#galaxies⚡#discoveries⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 In 2020, astronomers detected gravitational waves from the merger of two black holes with highly unequal masses—one about nine times heavier than the other—in a distant galaxy. This unusual event, named GW190814, created a final object weighing about 142 times the mass of our Sun, providing the first strong evidence for so-called "intermediate-mass" black holes that fill the mysterious gap between stellar and supermassive black holes. ✨
#gravitationalwaves⚡#blackholes⚡#discoveries⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The James Webb Space Telescope has discovered water vapor in the atmosphere of the exoplanet GJ 9827d, located about 97 light-years away in the constellation Pisces. This marks the first strong evidence of water on a planet smaller than Neptune outside our solar system, showing that even relatively small worlds can have atmospheres rich in life’s key ingredients. ✨
#exoplanets⚡#discoveries⚡#webb⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The James Webb Space Telescope has detected carbon dioxide on the exoplanet HD 189733b, a giant world 64 light-years away in the constellation Vulpecula. This is the first time carbon dioxide—a common gas on Earth—has been firmly identified in the atmosphere of an exoplanet, using Webb’s powerful infrared instruments to reveal details about the planet’s chemistry and hint at how its formation differs from giant planets in our own solar system. ✨
#webb⚡#exoplanet⚡#atmospheres⚡#discoveries⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🫶 Dear subscribers! We delighted that you're following our channel!
On our channel, you'll find everything about travel!
By using hashtags, you can easily find the content that interests you.
CHANNEL CONTENT:
📹#videoclips
🧭#expedition
🏔️#hiking
🤿#diving
🧨#unusualplaces
⛩#bridges
🏔#mountains
⌛️#facts
✈️#airplanecemeteries
🗻#hills
🏜#discoveries
🏖#beaches
🈴#China
🕌#India
💒#temples
🏤#architecturalmasterpieces
🚆#journeys
🏜#vacations
🎇#UNESCO
⛰#cliffs
🌋#canyon
🌊#lakes
🏢#skyscrapers
⛲️#waterfalls
⛴#dam
🏕#inaccessibleplaces
🌋#volcano
🚀#traveladvice
🌊#sea
🌲#forest
🏝#island
🌅#desert
🌫#ponds
⛰#cave
⭐️#travelhacks
⛺️#nationalpark
Thank you for being a part of our travel community!
Happy exploring!
🪐Discover upcoming expeditions — https://4elementos.shop