Мы используем 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
🎉 Celebrating the upcoming IHO of @RankerDAO on Hot Cross with a sweet giveaway!
🎁 $10,000 in #HOTCROSS
🎮 $10,000 in $RANKER
🏆 500 Winners ($40 each)!
To join the campaign, do the following:
🐷 Follow @hotcrossann & https://t.me/RankerDAO_ann Announcements
🐷 Join @hotcross & @RankerDAO TG Group
🐷 Follow https://twitter.com/hotcrosscom & https://twitter.com/RankerDAO?t=chy4IrKNI1nJpvz58lTjxA&s=09 on Twitter
🤞Mandatory task
♻️ + ❤️ = RT + Like
Fill the form below 👇🏼👇🏼👇🏼
https://t.co/SBRaDgUu5i
#airdrophttps://t.co/OdpjOYVT7v
🎂 We would like to wish our friends at @FrontierDotXYZ a happy 1-year anniversary for $FRONT!
🎁#Giveaway time! Woohoo!
🏆 Download the Frontier Crypto & DeFi Mobile App to receive your share of $10,000 in #HOTCROSS
🎁 To join the campaign, do the following:
🐷 Follow @hotcrossann Announcements
🐷 Join @hotcross TG Group
🐷 Follow https://twitter.com/hotcrosscom on Twitter
🔷 Follow https://twitter.com/frontierdotxyz on Twitter
🔷Follow @FrontierDotXYZ Announcements.
♻️ Retweet the event on Twitter:
Finally:
📨 Fill in the Gleam form for a chance to win!
https://t.co/VN0d12SIXGhttps://t.co/bUrhZX7I3n
Good luck 🤞.
🎊 Hot Cross hops into The Metaverse with SecondLive and an out of this world Blind Box Campaign!
🎂 To celebrate the 1-Year Anniversary of #BinanceSmartChain@bsc_official_announcement we are teaming up with @SecondLiveCommunity to give away Limited Edition #HOTCROSS blind boxes and mine $HOTCROSS during the festival.
🎁 To join the campaign, do the following:
🐷 Follow @hotcrossann Announcements
🐷 Join @hotcross TG Group
🐷 Follow Hot Cross on Twitter
🔷 Follow SecondLive on Twitter
🔷 Join @SecondLiveCommunity TG Group
♻️ Retweet the event on Twitter: https://twitter.com/hotcrosscom/status/1430478918423748613
Finally:
📨 Fill in the Gleam form for a chance to win!
https://hotcross.link/secondlive
Good luck to all in the Metaverse and Happy Anniversary to Binance Smart Chain!
🎂 Celebrating the Second hotcross IHO on #binancesmartchain.
🎁#Giveaway time! Woohoo!
20000$ in #Hotcross + $PEL for 1000 winners.
🎁 To join the campaign, do the following:
🐷 Follow @hotcrossann Announcements
🐷 Join @hotcross TG Group
🐷 Follow https://twitter.com/hotcrosscom on Twitter
🔷 Follow https://twitter.com/propelxyz
🔷Follow https://t.me/propelchat
🎆 Follow. https://t.me/propel_ann
♻️ Retweet the event on Twitter:
Finally:
📨 Fill in the Gleam form for a chance to win!
https://gleam.io/PJO9K/the-hot-cross-x-propel-iho-giveaway
Good luck 🤞.
🎂 Celebrating the first ever hotcross IHO on #binancesmartchain.
🎁#Giveaway time! Woohoo!
20000$ in #Hotcross + $toon
🎁 To join the campaign, do the following:
🐷 Follow @hotcrossann Announcements
🐷 Join @hotcross TG Group
🐷 Follow https://twitter.com/hotcrosscom on Twitter
🔷 Follow https://twitter.com/PontoonFi
🔷Follow https://t.me/pontoon_fi group
♻️ Retweet the event on Twitter:
☠☠Read article for more info - https://updates.hotcross.com/p/iho-pontoon-finance
Finally:
📨 Fill in the Gleam form for a chance to win!
https://gleam.io/tGZd0/the-hot-cross-x-pontoon-iho-giveaway
Good luck 🤞.