Мы используем 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
🌎 In 1843, Scottish inventor Alexander Bain patented the first electric clock. His design used electromagnetic pendulums powered by batteries, revolutionizing timekeeping accuracy for railways and industry. By 1845, electric clocks began synchronizing city tower clocks in England. ✨
#invention⚡#history⚡#technology
👉subscribe Interesting Planet
👉more Channels
🌎 The accidental invention of Velcro came after Swiss engineer George de Mestral examined burrs stuck to his dog in 1941. He found their hooks could inspire a new fastening system. Velcro's tiny hooks and loops mimic burrs’ natural grip, and it is now widely used in clothing, space suits, and shoes. ✨
#invention⚡#history⚡#engineering
👉subscribe Interesting Planet
👉more Channels
🌎 X-rays, discovered by Wilhelm Röntgen in 1895, revealed the hidden structure of the human body without surgery. The first X-ray image was of Röntgen’s wife’s hand, showing her bones and wedding ring. ✨
#history⚡#invention⚡#medicine
👉subscribe Interesting Planet
🌎 The first practical electric light bulb was invented by Thomas Edison in 1879. Edison’s design used a carbon filament inside a vacuum bulb, which could glow for over 1,200 hours before burning out. ✨
#invention⚡#history⚡#electricity
👉subscribe Interesting Planet
👉more Channels
🌎 A single spark started the Age of Electricity—when Michael Faraday discovered electromagnetic induction in 1831. This breakthrough showed how moving magnets can create electric current, laying the groundwork for generators, motors, and our modern electric world. ✨
#invention⚡#history⚡#electricity
👉subscribe Interesting Planet
🌎 Before the invention of the printing press, books had to be copied by hand, a process taking months or even years per copy. In 1440, Johannes Gutenberg developed the first movable type printing press in Germany, revolutionizing the spread of knowledge. The first major book he printed was the Gutenberg Bible, completed around 1455 and containing 1,282 pages. ✨
#printing⚡#history⚡#invention
👉subscribe Interesting Planet
👉more Channels
🌎 The printing press, invented by Johannes Gutenberg around 1440, revolutionized how information spread. Movable metal type allowed fast, affordable book production—leading to the first mass communication and fueling the European Renaissance. ✨
#invention⚡#history⚡#printing
👉subscribe Interesting Planet
First motorcycle ride — Nov 10, 1885: German engineer Gottlieb Daimler tested a two-wheeled, engine-powered vehicle, marking the birth of the motorcycle.
🏍️⚙️
[Read more]
@googlefactss
#history#transport#invention#nowyouknow
🌎 The accidental discovery of Teflon happened in 1938 when chemist Roy Plunkett was trying to make refrigerants. Instead, he found a slippery, nonreactive solid—polytetrafluoroethylene, now used for nonstick cookware and medical devices. The first Teflon-coated pan was produced in France in 1954. ✨
#invention⚡#chemistry⚡#materials
👉subscribe Interesting Planet
👉more Channels
Bubble Wrap was invented in 1957 by two engineers trying to make textured wallpaper. It didn’t work as wallpaper but became popular as packaging material. 🎈📦@googlefactss#BubbleWrap#Invention#Packaging
🌎 The MRI (Magnetic Resonance Imaging) machine was invented in the 1970s by Raymond Damadian, Paul Lauterbur, and Peter Mansfield. MRI uses strong magnets and radio waves to produce detailed images of organs and tissues inside the body, without using X-rays. The first full-body MRI scan was completed in 1977. ✨
#invention⚡#medicine⚡#imaging
👉subscribe Interesting Planet
👉more Channels
Fredric Baur invented the Pringles can. He died on May 4, 2008, at age 89. At his request, some of his ashes were buried in an Original flavor Pringles container. 🫙❤️
[Source]
@googlefactss
#Pringles#Invention#FunFact#FredricBaur
If you have ideas or feedback contact us:
@Googlefactss_Feedback_bot