Мы используем 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
🇬🇧#UK - Il parlamento ha approvato in via definitiva una legge per eliminare i 92 “membri ereditari” della Camera dei Lord, la camera alta del parlamento. È una decisione storica che metterà fine a una consuetudine che durava da più di 700 anni. (ilPost)
@UltimoraPolitics24
🇬🇧#UK Trump has been at the center of discussion due to a breach of protocol.
British social media is discussing an incident in which US President Donald Trump walked past Queen Camilla to shake hands with his acquaintances, which was considered a breach of protocol.
🇬🇧#UK. Armed police spotted outside a McDonald's in Kensington.
Armed Police arresting a suspect outside McDonald's. Armed response was deployed due to intelligence suggesting high risk,possible weapon or violence, it's standard UK protocol for public safety. Police haven't released specifics on the exact reason or threat yet, as it's an active investigation.
(By the looks of one of those green dots, someone has had far too much coffee.)
Follow us -> LiveLeak
#UK: Il Regno Unito ha affermato che non parteciperà alle operazioni militari contro l'Iran, anche se il governo si è espresso in supporto agli obiettivi dichiarati dagli USA e Israele.
🇬🇧The Psychological Attack on the UK, Part 2 | UKColumn - 2021
If Bezmenov had been correct in just one or two of his predictions, then we might assume that coincidence was at work. In reality, he was correct in all of his predictions. Common sense therefore tells us that the plan he describes must be both real and effective. And that plan ultimately leads from 'Demoralisation' to 'Destabilisation', to 'Crisis' (Chaos) and then 'Normalisation' — so-called 'peace' (actually pacification) under a socialist/communist dictatorship of global scale.
In Part 2 as we tackle the key subversively targeted area of Security (covering the intelligence community, police and military), but first we address the demoralising and destructive plans detailed for Law and Order and Social Relations.
To recap, the following descriptive paragraph sets out the key warning within Story's highly detailed and meticulously researched book:
The European Union Collective Enemy of its members states
@ukcolumn@EastApp
#UK
🇬🇧The Psychological Attack on the UK: Start of a Series | UKColumn – 2021
Alex Thomson and Brian Gerrish discuss the origins of the psychological attack on the UK in the first part of a series. Our starting documentation and analysis centres on the book by Christopher Story: The EU Collective - Enemy of its Members States.
@ukcolumn@EastApp
#UK
🇬🇧#UK: Footage shows tens of thousands of protesters marching through London as two rival demonstrations, the “Unite the Kingdom” rally and a large pro-Palestine march, take place simultaneously across the capital.
According to police, at least 11 people have been arrested since the demonstrations began.
🇬🇧#UK: London is preparing for one of its largest public order operations in recent years as two major demonstrations, the pro-Palestine “Nakba Day” march and the “Unite the Kingdom” rally organised by Tommy Robinson, take place simultaneously this weekend in central London, alongside the FA Cup Final.
For the first time in a protest policing operation in the UK, live AI facial recognition will be used alongside aerial surveillance employing helicopters and drones, as well as armoured vehicles and large-scale specialist policing units deployed across the capital. Around 4.000 officers will be involved in the operation, with reinforcements from forces across England and Wales, as authorities reportedly prepare for "significant public order risks" across multiple protest routes.
(via Reuters & BBC)