Мы используем 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
🪩Nick Fanciulli at Savaya Bali
📆 Sunday, 12 January
Nic Fanciulli is a respected figure in electronic music, recognised for his Grammy-nominated remix of Gorillaz's ‘Dare’ and for founding the influential Saved Records label. His credits include projects such as The Social festival with top artists, as well as appearances at venues such as Space Ibiza and Tomorrowland, cementing his legacy in the dance music scene.
🔍 Details of the event, as well as tickets, are available on the official website.
@BaliNews
#wheretogo#events#parties
🥳A four-day Halloween party in Kuta
🔔 Starting tomorrow, October 30, Old Man's will be hosting a series of Halloween parties starting at 5:00pm.
Come dressed to impress as your favorite ghoul, ghost, or Halloween character for a chance to win big in our spine-chilling costume contest.
🎫 Tables for one-day start from Rp2,400,000 – included entrance fee for 4 pax, 1 bottle of house pouring and 4 mixers.
👨💻 More information via the link.
@BaliNews
#wheretogo#parties#Kuta
🪩 There will be a party at Savaya on Saturday
ℹ️ Building upon her cultural heritage and her musical tastes (the artist grew up listening to artists such as Nina Simone, Bob Marley and Marvin Gaye), AWEN started to produce her unique style of Afro-house.
🧞♀️ It mixed electronic instrumentation with timeless melodies - and a touch of spirituality.
📲 More info and tickets (Rp 600,000) are here.
#wheretogo#parties#Badung@BaliNews
⭐️Electronic music star Boris Brejcha in Bali
📍 Savaya Bali
📆 May 18, 2005
⏰ Doors Open at 1:00 pm
🔞 Entry strictly 21+
🎟 Rp1,350,000
🪩 German DJ Boris Brejcha is known to all lovers of techno and mind-blowing parties. As part of his world tour he will be stopping by Bali.
🔎 More information and tickets here.
@BaliNews
#events#parties#Badung
🪩Morabito presents Bombossa Brothers
📍 Morabito Art Villa, Canggu
📅 Friday, February 28
⏰ 6:00 pm
Bombossa Brothers are twins with two interesting personalities and one mission: to entertain as many people as possible with their groovy melodic sound. Over the past couple of years, they have built up their reputation as a duo to watch by playing around the world and expanding their Momentum event series, hosting up to 2000 people in their hometown of Tallinn, Estonia.
🎫Tickets at the link from 250.000 IDR.
@BaliNews
#wheretogo#parties#Canggu