Мы используем 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
🌎 Trapped in an Andes avalanche in 1972, survivors of a plane crash endured 72 days in freezing mountains, rationing food and melting snow for water—proving human resilience in the harshest conditions. ✨
#survival⚡#history⚡#resilience
👉subscribe Interesting Planet
🌎 The Resurrection Fern can survive months or years without rain by curling up and looking dead. With just a splash of water, it springs back to vibrant green life, showcasing an extraordinary natural survival trick for drought-prone environments. ✨
#plants⚡#adaptation⚡#resilience
👉subscribe Interesting Planet
🌍 Some coral reefs in the Red Sea host unique fish and coral species that can tolerate extreme heat and high salt levels, making them among the most resilient reef ecosystems on Earth. ✨
#coral⚡#marine⚡#resilience⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
Ad Al-Wafa, a Gaza, questa settimana si è celebrata la cerimonia di fine anno scolastico per migliaia di bambini.
Un evento che in condizioni normali sarebbe stato occasione di festa ma che si è trasformato in un momento intriso di dolore. I volti dei piccoli brillavano d’orgoglio mentre ricevevano i diplomi ma dietro ai sorrisi si nascondeva un vuoto profondo: nessun genitore ad applaudirli, nessuno a scattare foto o a sussurrare parole di incoraggiamento.
Un rapporto dell’ONU rivela che oltre il 90 % delle scuole e università sono state danneggiate o distrutte, privando dell’istruzione più di 800.000 bambini e ragazzi e interrompendo la vita accademica di circa 90.000 universitari. Oggi tutti questi ragazzi studiano in tende di fortuna gestire da Unicef, ONU E UNRWA continuamente bersagliate dall’artiglieria di Israele.
#gazagenocide#gazastudents#resilience
🌎 Trapped under debris for 17 days after a 2015 Nepal earthquake, Pemba Tamang survived by drinking muddy water dripping from rubble and eating small snacks. He emerged with only minor injuries after nearly 2½ weeks underground, making it one of the longest earthquake survival cases recorded. ✨
#survival⚡#earthquake⚡#resilience
👉subscribe Interesting Planet
👉more Channels
🌎 The tardigrade’s cousin, the rotifer, can survive drying out for decades by entering a state called cryptobiosis. When water returns, it wakes up as if nothing happened, showing remarkable resilience in the micro-world. ✨
#rotifer⚡#cryptobiosis⚡#resilience
👉subscribe Interesting Planet
As the 60-day ceasefire deadline ended, the people of southern #Lebanon returned to their homes despite Israeli violence. 15 martyrs and 83 injured in the ongoing struggle for their land.
#DayOfReturn#CeasefireDeadline#Resilience#Israel#SouthernLebanon#Occupation
After over a year of displacement, the people of southern #Lebanon return—not to homes, but to the land scarred by Israeli aggression. Their spirit is unbroken.
#Resilience#SouthernLebanon#ReclaimingHome#Rebuilding#Israel#LebaneseArmy
🚀 South Korea's Central Bank Governor: Export Performance Exceeds Expectations
South Korea's central bank governor, Lee Chang-yong, has stated that the country's export performance has surpassed expectations. According to Jin10, Lee highlighted the positive export figures during a recent address, noting that the results are better than initially anticipated. This development comes amid ongoing global economic challenges, where South Korea's export sector has shown resilience and adaptability. The improved export performance is seen as a crucial factor in supporting the nation's economic stability and growth. Lee's remarks underscore the importance of exports in South Korea's economic strategy, as the country continues to navigate complex international trade dynamics.
#SouthKorea#CentralBank#ExportPerformance#EconomicGrowth#GlobalEconomy#Resilience#TradeDynamics#LeeChangYong#EconomicStability
When kids have big emotions, we tend to think they are being overly sensitive, that they need more resilience. Most of the time it is because there is a lot happening for the child that we can't see and don't know, that is pushing them beyond their means of coping. Instead we can change the response from they are overreacting, to seeing a child who has a lot happen for them, they are doing the best they can. They need our help not judgement.
#parenting#positiveparenting#gentleparenting#resilience#respectfulparenting#psychologist#play#playtherapy#childdevelopment#childtherapy#parentingtips#teachers#asd#family#life#adhd#mumlife#momlife#dads#consciousparenting
https://www.instagram.com/p/Ctd93W8vEM9/