Мы используем 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
Mientras el mundo se moviliza por Palestina y tratar de desbloquear Gaza, EE.UU. aprovecha de atacar a Irán con impunidad.
Así negocia EE.UU.
Qué alivio saber que Donald Trump sigue comprometido con "la diplomacia"... a su manera. No hay mejor Acuerdo de Paz que advertirle a un país entero que será reducido a cenizas.
#iran
#gaza
#gazaunderattack
#breakthesiege
#usdiplomacy
#diplomacy
🚀 U.S. Vice President Vance Heads to Islamabad for U.S.-Iran Talks
U.S. Vice President Vance has departed for Islamabad, Pakistan, aboard Air Force Two to participate in negotiations between the United States and Iran. According to BlockBeats, accompanying him are U.S. Special Envoy for Middle East Affairs, Whitaker, and U.S. President Donald Trump's son-in-law, Kushner.
Before boarding, Vance expressed optimism about the upcoming talks with Iran, stating that he anticipates positive discussions in Islamabad. He emphasized that if Iran approaches the negotiations with sincerity, the United States will remain open-minded. However, he cautioned Iran against attempting to 'play games with the United States.' Vance noted that U.S. President Donald Trump has provided 'quite clear guidelines' for the negotiations.
#USVicePresident#Vance#Islamabad#USIranTalks#MiddleEastAffairs#Kushner#DonaldTrump#USDiplomacy#IranNegotiations
🚀 Israel-Hezbollah Conflict Complicates U.S.-Iran Relations
The ongoing conflict between Israel and the Iran-backed Lebanese militia Hezbollah is adding complexity to the United States' efforts to resolve its longstanding tensions with Iran. Bloomberg posted on X, highlighting the intricate geopolitical dynamics at play.
The hostilities between Israel and Hezbollah have intensified, with both sides engaging in military actions that threaten to escalate further. This situation is complicating U.S. diplomatic strategies aimed at de-escalating tensions with Iran, as Hezbollah's actions are closely linked to Iranian interests in the region.
The U.S. has been attempting to negotiate with Iran to address various issues, including nuclear capabilities and regional influence. However, the involvement of Hezbollah, a significant player in the Middle East conflict, poses challenges to these diplomatic efforts.
As the situation unfolds, the international community is closely monitoring developments, with concerns about potential broader implications for regional stability. The U.S. continues to navigate these complex relationships, seeking a resolution that addresses both its strategic interests and the security concerns of its allies in the region.
#Israel#Hezbollah#USIranRelations#MiddleEastConflict#Geopolitics#USDiplomacy#Iran#Lebanon#RegionalStability#NuclearNegotiations#MilitaryEscalation#InternationalRelations