Мы используем 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
Welcome, New Space Cadets! 💫
Since Monday, we've welcomed an incredible 600k new space cadetsto our mission! 🚀 With so many explorers joining, here's a quick reminder about the journey ahead.
Your ship and crew are built for one epic trip only. After each successful mission to the moon, you level up and need to construct a brand new spaceship🚀 and recruit a fresh crew to set off on your next journey.
🌌New Ship: Each mission gives you the opportunity to build even cooler, more powerful ships. Your level increases with every successful expedition, unlocking better designs and greater mining power.
🌌Fresh Crew: Invite new friends to join your adventures. Each new expedition requires a full crew, and more friends mean greater strength and success. No friends? No prob! Use special bots.
🌌Continuous Exploration: The adventure never ends! Keep exploring the cosmos, completing missions, and reaping stellar rewards.
🌌Balance Intact: Levelling up doesn’t reset your Space Bucks balance. You keep all your hard-earned Space Bucks as you progress.
ℹ️ For more info, check the mission manual here.
Every journey helps you level up, bringing you closer to mastering the cosmos. So gear up, build your fleet, and keep pushing the boundaries of space exploration: the end of season 1 & the first token airdrop are coming!🔔
👉Start your To The Moon adventure now!👈
Website | Telegram Chat | X | Discord | Medium
#ToTheMoon#MoonPlay#ecosystem#blockchain#gamefi#web3#wenlisting#squad#rank#communityfirst#taptap#clicker#game
Squad Multiplier: Earn More💰
If you haven’t joined a squad yet, you’re missing out on a fantastic way to turbocharge your 💸 earnings and complete expeditions faster.
Whether you team up with friends or join forces with other players, being in a squad is your ticket to higher earnings. Head to the Crew tab—> Squads👥, check out the top squads on the leaderboard, or create your own and invite others to join.
The higher your squad’s rank, the bigger the Space Bucks multiplier, up to a whopping 1.5x! After three days in a squad ⏰, you start benefiting from the squad’s multiplier. Your squad’s rank boosts your:
💸 Mining income
✅ Mission rewards
🌕 Expedition rewards
💫 Star Dust rewards
So, what are you waiting for? Team up, level up, and watch your earnings skyrocket. Who’s going to be the first Rank 3 Squad in the game? Let’s wait and see!
👉Start your To The Moon adventure now!👈
Website | Telegram Chat | X | Discord | Medium
#ToTheMoon#MoonPlay#ecosystem#blockchain#gamefi#web3#wenlisting#squad#rank#communityfirst#taptap#clicker#game
Can You Catch The LEPrechaun? 🍀
Hey Space Cadets!
We're excited to announce a fantastic new partnership with LEPrechaun🎩! This summer, LEPrechaun is bringing a bottomless pot of $LEP coins - and you've got a chance to join the gold rush. Join their pre-launch on Telegram now and secure an airdrop for early users!
But that's not all! LEPrechaun is also introducing 4 fresh missions✅ for you, our brave explorers. Head to the Missions tab and check them out to boost your progress in ToTheMoon! and start earning $CLOVER in LEPrechaun bot.
Don't miss out on this stellar opportunity!
👉Start your To The Moon adventure now!👈
Website | Telegram Chat | X | Discord | Medium
#ToTheMoon#MoonPlay#LEPrechaun#partnership#ecosystem#blockchain#gamefi#web3#wenlisting#squad#rank#communityfirst#taptap#clicker#game