Мы используем 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
Cholesterol protects the integrity of cell membranes and keeps cells healthy and strong. If a person’s cholesterol level were 0 (an impossibility), his cell membranes would be dry and cracked and all the cell content would leak out.
@googlefactss#humanbody
For most women (about 65%), the left breast is bigger than the right one. Researchers are unsure why, but they point to hormonal influences during development.
@googlefactss#humanbody
A human spinal cord stops growing in length around age four or five, while the vertebral column (spine) continues to grow until late adolescence or early adulthood.
@googlefactss#humanbody
In a condition called pelvic prolapse, a woman’s vagina can literally fall out and hang between the legs. Pelvic prolapse, however, can often be fixed..
@googlefactss#humanbody
[read more...]
The same skin cells that make up a human vagina are the same type of cells that are in a human mouth. The nonkeratinized stratified squamous epithelium are types of mucous membranes that are sensitive, absorbent, and continuously shed and regenerated.
@googlefactss#humanbody
It is common and normal for mothers to poop while giving birth. This often happens during the pushing stage because the muscles used to push a baby out are the same ones used to have a bowel movement.
@googlefactss#humanbody#nowyouknow
Occasionally, human corpses can undergo saponification, a process in which body fat transforms into adipocere through a chemical reaction. Adipocere has a consistency similar to semi-hard cheese and possesses a soapy feel. The most well-known example of this phenomenon is the "Soap Lady," a 140-year-old mummy showcased in Pennsylvania.
@googlefactss#humanbody#nowyouknow
Myth: The tongue is divided up into specific areas that are solely responsible for sensing certain tastes (e.g., sweet at the tip, bitter at the back)
Fact: The tongue's receptor cells that identify the molecules underlying the basic tastes (sweet, sour, salt, bitter and umami) are distributed on taste buds all over the tongue although some areas may be slightly more sensitive to certain flavors..
@googlefactss#humanbody#nowyouknow#mythbusted
[read more...]
Fingernail facts:
The middle finger’s nail grows the fastest while the smallest finger’s grows the slowest.
Nails usually grow faster on your dominant or more active hand (more use → more repair → more blood/nutrients) and speed up in summer thanks to better circulation.
Toenails grow slower.
Overall, males’ nails often grow faster than females’, but during puberty and pregnancy higher hormone levels make nails grow quicker in women.
[Source]
@googlefactss
#FunFact#HumanBody#nails