Мы используем 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
Audi has officially unveiled the new generation A6!
Now, this index belongs to electric vehicles — a liftback and an estate version.
🚘 The exterior of the new models is almost entirely copied from the namesake concepts, while the interior is inspired by the Q6 e-tron crossover.
🚢 The base version will be the rear-wheel drive A6 e-tron performance with a single motor producing 367 hp. For the S6, there will be two motors delivering 550 hp and accelerating from 0 to 100 km/h in just 3.9 seconds, with a top speed of 240 km/h.
🔋 In both cases, a 100 kWh battery is provided, allowing the single-motor versions to travel up to 756 km, while the all-wheel drive versions can reach up to 675 km.
ℹ️ Pre-orders will start in September, with prices starting at €75,600 for the standard version and €99,500 for the S6.
#Audi#A6#ElectricVehicles#ETRON#CarLaunch#LuxuryCars#Innovation#S6#Auto
🚗✨Introducing the Audi Q6 e-tron Sportback!✨🚗
The sleek new Sportback version features a more aerodynamic design, reducing the drag coefficient from 0.28 to 0.26! 🌬️ This enhancement boosts the range to an impressive 656 km on a single charge! 🔋💨
🔧Powertrain Options:
• Rear-wheel drive versions come with a single electric motor delivering 252 or 306 hp paired with 83 or 100 kWh batteries. ⚡️
• The all-wheel drive variant boasts 387 hp, accelerating from 0 to 100 km/h in just 5.9 seconds! 🚀
• The top-tier SQ6 Sportback e-tron unleashes an incredible 489 hp, hitting 100 km/h in only 4.3 seconds! 🏁🔥
🏭 Production is set at the Ingolstadt plant, with prices starting at €65,900 and going up to €96,200. 💰
#AudiQ6#eTron#Sportback#ElectricVehicle#EV#SustainableDriving#LuxuryCars#Innovation#AudiFamily#Auto🚘🌍