Мы используем 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
Scientists found a new drug, SW033291, that protects the brain’s blood barrier by blocking an enzyme called 15-PGDH. This stops brain damage and memory loss in mice with Alzheimer’s and brain injuries. Unlike other drugs, it does not remove amyloid protein but still keeps the brain safe and working well. The drug worked even when given a day after injury.🧠💊
[Source]
@googlefactss
#Alzheimers#BrainHealth#Memory#Science
lethonomia (n)
pronunciation: leh – tho – NO – mee – uh
language: English
definition: the inability to recall someone’s name
sentence: It’s very embarrassing to be stricken with acute lethonomia when I have to make introductions at a party. 🧠🗣️
[Source]
@googlefactss#Lethonomia#Memory#LanguageDisorders#BrainHealth#CommunicationChallenges
Learning another language may slow brain aging, according to a huge new study. Multilingual people show less cognitive decline compared to those who speak only one language. The study suggests that speaking multiple languages helps keep brain networks active, especially those responsible for memory and attention, protecting the brain from aging effects.
🧠🌍💬
[Read more]
@googlefactss
#BrainHealth#Multilingual#CognitiveScience#Learning#HealthyAging
Some studies found that watching a lot of (internet)pornography can change the brain. Brain scans showed stronger links in areas that control emotions and decisions. People who watch often feel more pleasure but have less self-control. After watching, their thinking and attention get worse. Their facial expressions also show less emotion, like surprise or disgust, even if they say they enjoyed it. These changes are similar to drug addiction. Repeating this behavior can make emotional responses dull and reduce mental sharpness.
More research is needed, but finding people who never watched porn for studies is very difficult to impossible..
🧠📉
[Read more1]
[Read more2]
[Read more3]
[How to stop watching]
@googlefactss
#BrainHealth#Addiction#Pornography#porn#MentalHealth#Neuroscience
👮♂🚫Warning: Even though this post and the following poll are sexual in nature. Rules still apply. Be respectful or face the consequences..