Мы используем 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
विकास पथ को गति दे रहे भारत के राष्ट्रीय राजमार्ग।। 🛣️
भारत के सड़क नेटवर्क के विस्तार के साथ-साथ प्रगति की यात्रा का गवाह बनें। यह परिवर्तन वास्तव में #NewIndia की गति और विकास का प्रमाण है।
#InfrastructureDevelopment
#Highway
Experience high-speed connectivity for industrial centres with the Nashik Phata – Khed Corridor!
Enhancing travel between Pune and Nashik along NH-60, this corridor reduces congestion around Pimpri-Chinchwad, fostering industrial growth and smoother transportation.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
Guwahati's connectivity gets a major boost with the new Northern Guwahati Bypass!
Upgrading the existing bypass and constructing a major bridge over the Brahmaputra, this project will significantly improve travel efficiency and support regional development.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
The Kanpur Ring Road project will complete the 6-lane National Highway Ring around Kanpur!
Enhancing traffic flow and reducing congestion, this project is set to transform Kanpur’s connectivity, making travel within the city and to other regions smoother and faster.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
Boost industrial connectivity with the Pathalgaon & Gumla sections of the Raipur-Ranchi National High-Speed Corridor!
Linking mining areas in Gumla, Lohardaga, Raigarh, Korba, and Dhanbad to industrial zones in Raipur, Durg, Bilaspur, and Bokaro, this project promotes faster, efficient transportation.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
Pilgrims can now reach Ram Mandir via the Ayodhya Ring Road!
This project facilitates quicker movement for devotees visiting the sacred site, enhancing the spiritual journey and supporting regional tourism and infrastructure development.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
Ensure smooth freight movement with the Tharad – Deesa – Mehsana – Ahmedabad National High-Speed Corridor!
This corridor links industrial regions in Punjab, Haryana, and Rajasthan to major ports in Maharashtra, enhancing logistics efficiency and boosting industrial growth.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
Unlock the North East with the Kharagpur-Moregram National High-Speed Corridor!
Connecting West Bengal, Odisha, and Andhra Pradesh to the North-East, this project will increase traffic capacity by over 5 times, promoting regional development and improving travel efficiency across these states.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
Travel faster to iconic landmarks with the Agra-Gwalior National High-Speed Corridor!
Enhancing connectivity to tourist hotspots like Taj Mahal, Agra Fort, and Gwalior Fort, this corridor will double traffic capacity and cut travel time by 50%.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
Experience seamless travel with 8 national high-speed road corridors spanning 936 km!
With an investment of Rs 50,655 crore, these corridors are set to revolutionize connectivity and boost economic growth across India.
#InfrastructureDevelopment#NewIndia
#TransformingIndia
India's National Highways - From Roadblocks To Road Wonders!
Witness the wide ride of progress as India's road network expands, solidifying its position as one of the largest in the world. This transformation is truly a testament to #NewIndia's growth and development.
#InfrastructureDevelopment
#Highway