Мы используем 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
Amplify your impact through our KOL Wavemaker Program — with priority access to deal flow from 700+ crypto projects, you'll be part of a connected and passionate community.
Sign up here: https://www.dwf-labs.com/wavemakers
P.S. Only shortlisted KOLs will be contacted.
#DWFLabsxWaveMaker
Boost your influence with our KOL Wavemaker Program! Gain exclusive access to deal flow from over 700 crypto projects and join 200 other KOLs in our vibrant, engaged community.
Sign up here: https://dwf-labs.com/wavemakers
P.S. We will reach out only to shortlisted KOLs.
#DWFLabsxWaveMaker
Over 150 KOLs have been onboarded to our exclusive Wavemaker program ⚡
Come join them and gain access to deal flow from over 700 projects.
Register here: https://dwf-labs.com/contact/kol
P.S. Only shortlisted KOLs will be contacted.
#DWFLabsxWaveMaker
Amplify your impact through our KOL Wavemaker Program - with priority access to deal flow from 700+ crypto projects, you'll be part of a connected and passionate community.
Sign up here: https://www.dwf-labs.com/wavemakers
P.S. Only shortlisted KOLs will be contacted.
#DWFLabsxWaveMaker
Don't miss out on this opportunity to amplify your impact through our KOL Wavemaker Program - we are always looking to cultivate long-term partnerships with top tier creators. 💥
With priority access to 700+ crypto projects, you'll be part of a connected and passionate community.
Sign up here: https://www.dwf-labs.com/contact/kol
P.S. Only shortlisted KOLs will be contacted.
#DWFLabsxWaveMaker
Gain priority access to 700+ crypto projects and be part of a connected and passionate community. Join us now to amplify your impact through our KOL Wave Maker Program! 🔥
https://www.dwf-labs.com/contact/kol
#DWFLabsxWaveMaker
Ready to take your influence to the next level? 💥
Join our community and leverage our network for growth. With priority access to 700+ crypto projects, the possibilities for creators are endless.
Sign up here: https://www.dwf-labs.com/kol
#DWFLabsxWaveMaker
Thank you to our community for the amazing response to our Wave Maker Program! We've received lots of great applications.🔥
Reminder: Please ensure your X handle is correct in your application. We're working hard on reviewing submissions - keep an eye on your DMs and emails!
https://www.dwf-labs.com/kol
#DWFLabsxWaveMaker
Exciting news! 🎉 We are thrilled to announce the launch of our Wave Maker Program for KOLs looking to work with us.
Join us as we grow together. 🤝
https://www.dwf-labs.com/kol
#DWFLabsxWaveMaker
DWF Labs Haus is coming to #KBW2024 and #TOKEN2049! Come meet with industry leaders and our top tier KOL community in Seoul and Singapore 🤝
All approved DWF Labs KOLs will receive priority registration approval for our events, as well as access to exclusive deal flow from over 700 projects. If you have yet to join our community, register here: https://dwf-labs.com/wavemakers
Register for DWF Labs Haus: Korea Blockchain Weekhere.
Register for DWF Labs Haus: TOKEN2049 Singaporehere.
P.S. We will only reach out to shortlisted KOLs.
#DWFLabsxWaveMaker