Мы используем 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
“When they attacked some village, they called all the people to one place. ‘Everyone must follow us and our religion. If not, we must shoot you,’” says Khuseini from Nigeria about Boko Haram terrorists.
This criminal group is responsible for killing thousands of people. Khuseini and his family fled their hometown when Boko Haram arrived. Now he lives in the Dar es Salaam refugee camp and teaches Arabic to kids at the local school. Khuseini says the kids are deeply traumatised by the terrorists’ brutality. They remember how Boko Haram attacked their town, killing their friends. There are machine guns, blood, and killings even in kids’ drawings.
Today is Children’s Day in Nigeria. Watch the clip to see how kids – Boko Haram’s victims - live in the refugee camp and try to get back to everyday life. Then, find out more in our documentary Hot Spot Chad.
#crime
Follow: https://t.me/rtdocumentary
‘He’s not resisting arrest; he’s on the ground. You’ve him in handcuffs. Why is there a need to hit him in the back with a rifle?’ – asks a desperate mother whose child died due to police brutality. Quincy and his girlfriend argued, he left the house, leaving her angry. She called the police and told them he had a rifle. That fatal lie cost Quincy his life. Five police officers didn’t even intend to find out the truth but tackled and beat the young man to death.
Cases like this are common in the USA. Hundreds of people die every year at the hands of law enforcement officers. Watch the clip to see some cases. Do you think it’s possible to change the situation? See the documentary Once Upon A Crime to learn what people do to stop police brutality.
#crime
Follow: https://t.me/rtdocumentary
🎬 Adolescence
Gênero: #Crime, #Drama
⭐️ IMDb: 8.1
⏳ Duração: 15 Episódios
📝 Sinopse:
Quando um garoto de 13 anos é acusado do assassinato de um colega de classe, sua família, o terapeuta e o detetive responsável ficam perguntando o que realmente aconteceu.
Fonte: IMDb
🔵Inscreva-se em @Assistir
*Patrocinado: Anime Bot
🍿 'The Penguin': The Most Anticipated Spin-off of 'The Batman' 🎬
📆Premiere: September 19, 2024
🎭Genre: #Crime · #Drama
Colin Farrell dives into the role of Oz Cobb, aka The Penguin, in this series that promises to expand the universe of Matt Reeves' 'The Batman.' With 3.5 hours of daily makeup, Farrell transforms into Gotham's crime boss. The trailer, unveiled at Comic-Con, left everyone in awe. 🎥
The interesting part is how Reeves initially planned a series for DC, and HBO finally made it happen. Cristin Milioti and Rhenzy Feliz join Farrell in an impressive cast. And watch out! The Penguin will return in 'The Batman II' in 2026. 🦇✨
🍿The Penguin: Colin Farrell Returns to Gotham
📆Release: Fall 2024
🎭Genre: #Crime · #Drama
The new trailer for 'The Penguin' brings Colin Farrell back as Gotham's infamous gangster, Oswald Cobblepot. This spin-off from Matt Reeves' 'The Batman' follows Cobblepot's rise to power after the death of Carmine Falcone. 🚦🔫
What's really fascinating is how Farrell's makeup has evolved, giving him an even more menacing look true to the iconic DC villain. Plus, the brewing tension with Sofia Falcone, played by Cristin Milioti, promises electrifying drama. Don't miss this thriller, which is already shaping up to be a hit. 🌆🔥
> 𝘴𝘦𝘳𝘪𝘦𝘴 · 🚀𝘣𝘰𝘰𝘴𝘵