Мы используем 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
#TakeResponsibility
If you observe any of these signs and symptoms, visit a healthcare facility for an accurate diagnosis and treatment.
Ensure you take extra precautionary measures while visiting to prevent the risk of spread.
Fake news can cause unnecessary anxiety and panic. PAUSE, and verify before you share!
Citizens are urged to take the recommended actions required to protect their families, friends, and selves.
🔗
https://ncdc.gov.ng/news/493/official-statement-on-the-new-covid-19-subvariants
#TakeResponsibility
Seek the advice of a qualified healthcare professional when you feel sick.
Self-medication can be harmful.
#TakeResponsibility by using antimicrobials appropriately
Seek the advice of a qualified healthcare professional when you feel sick.
Self-medication can be harmful.
#TakeResponsibility by using antimicrobials appropriately
Meningitis can affect any age group but is more common in children and young adults.
Visit a health center facility for immediate attention if you observe any of the below symptoms.
#TakeResponsibility to stay safe
Drugs save lives, however, they can harm when not taken properly.
Using drugs “anyhow” makes the treatment of infections more difficult.
Visit a healthcare professional when sick for accurate diagnosis and treatment.
Do not self-medicate!
#TakeResponsibility
Parents & caregivers should ensure that their children/wards receive the anti-diphtheria vaccine as recommended in the NPHCDA childhood immunisation schedule.
Visit a primary health care centre close to you to get the vaccine.
#TakeResponsibility
Parents & caregivers should ensure that their children are fully vaccinated against diphtheria with three (3) doses of the pentavalent vaccine as recommended in the childhood immunisation schedule.
#TakeResponsibility to protect yourself & loved ones
🔗
https://ncdc.gov.ng/news/435/diphtheria-public-health-advisory-amidst-outbreak-in-nigeria
The elderly, immunocompromised and those with existing health concerns are advised to:
➡️Wear face masks in outdoor spaces
➡️Wash hands regularly with clean water and soap
➡️Use hand sanitisers
➡️Avoid large gatherings
#TakeResponsibility to stay safe and healthy.
A clean environment and proper hygiene limit the spread of infectious diseases.
Clean all surfaces frequently and do not share personal items.
#TakeResponsibility to protect yourself and your loved ones.
To protect yourself and loved ones from Ebola virus disease, #TakeResponsibility:
✅Wash your hands using soap and running water
⛔Avoid direct handling of dead bats, monkeys etc
⛔Avoid physical contact with anyone with undiagnosed symptoms
📜Advisory
https://ncdc.gov.ng/news/423/public-health-advisory-following-declaration-of-ebola-virus-disease-outbreak-in-uganda
ДжоПи:
Как найти вопрос, на который не знаешь ответа?
Это как найти шапку, которую уже надел,
Но забыл об этом.
Как пристроить ответ, на который не задан вопрос?
(У меня их столько за жизнь заготовлено.)
Как снежков налепить в одиночку,
а не в кого бросить.
Вот прибрался в комнате,
и день прошёл.
А план не изменился.
#bitnev#стихи#takeresponsibility