Мы используем 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
🇷🇺🇺🇳 Foreign Minister Sergey Lavrov & Secretary-General of the United Nations António Guterres meet on the sidelines of the UN General Assembly's 77th Session's High-Level Week.
#UNGA77
#UNCharterIsOurRules
🇺🇳 The High-Level Week of the 77th Session of the UN General Assembly has come to an end.
#Day4 main highlight 👉 FM Sergey Lavrov's Remarks at the General Debate.
The Minister touched upon the most topical issues on the international agenda.
📹 The essence of the speech in 1 minute.
#UNGA77
🇺🇳 The UN HQ is where it's at! The High-Level Week of the 77th UNGA Session continues as does our coverage!
🎥 On #Day3 (Sept 23), the Russian delegation led by Sergey Lavrov kept busy. Sorry to disappoint certain Western colleagues, but no "isolation" in sight:
• Talks with President of Serbia and President of Guinea-Bisau
• Talks with Chairman of the Transitional Sovereignty Council of Sudan
• Meetings and talks with Foreign Ministers of Serbia, Мexico, Ethiopia, Nicaragua, Laos, Jordan, Syria, Eritrea, Cuba, Equatorial Guinea, Mali, the UAE!
• Russia – Gulf Cooperation Council Ministerial
Stay tuned and follow our updates from New York!
#UNGA77
🛑#LIVE: Foreign Minister Sergey #Lavrov gives speech at the UNSC meeting on Ukraine
🔗https://www.ruptly.tv/en/events/202209221400-LIVE11963-UN-Security-Council-holds-high-level-debate-on-Ukraine
🔗https://mid.ru/en/press_service/video
🔗https://media.un.org/en/webtv
#UNGA77
Off we go! 🇺🇳
#Day1 highlights!
On September 21, Sergey Lavrov arrived to the United Nations Headquarters in New York to participate in the 77th Session of the UN General Assembly (#UNGA77).
🤝 On the first day the Minister's working schedule was packed:
• Working meeting of CSTO Foreign Ministers
• Talks with President of the CAR Faustin-Archange Touadéra and President of Switzerland Ignazio Cassis
• Meetings with Ministers of Foreign Affairs of China, Brazil, Bolivia and Egypt
• Meetings with President of the ICRC Peter Maurer and IAEA Director General Rafael Mariano Grossi
• Meeting in the Astana Format
• The signing of The Inter-Ministerial Consultations Plan between the Foreign Ministries of Russia and Venezuela
• Talks with President of the 77th UNGA session Csaba Kőrösi
Stay tuned for #Day2. Coming next!
Off we go! 🇺🇳
#Day1 highlights!
On September 21, Sergey Lavrov arrived to the United Nations Headquarters in New York to participate in the 77th Session of the UN General Assembly (#UNGA77).
🤝 On the first day the Minister's working schedule was packed:
• Working meeting of CSTO Foreign Ministers
• Talks with President of the CAR Faustin-Archange Touadéra and President of Switzerland Ignazio Cassis
• Meetings with Ministers of Foreign Affairs of China, Brazil, Bolivia and Egypt
• Meetings with President of the ICRC Peter Maurer and IAEA Director General Rafael Mariano Grossi
• Meeting in the Astana Format
• The signing of The Inter-Ministerial Consultations Plan between the Foreign Ministries of Russia and Venezuela
• Talks with President of the 77th UNGA session Csaba Kőrösi
Stay tuned for #Day2. Coming next!