Мы используем 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
📍 Mount Teide, Tenerife Island, Spain 🇪🇸
🌋 Mount Teide is located in the center of the largest of the Canary Islands - Tenerife. The mountain, which can be seen today from any point on the island of Tenerife, grew more than a hundred thousand years ago from the depths of the ancient stratovolcano Las Cañadas, the top of which once collapsed inward under the weight of the erupting lava.
This majestic peak, standing at 3,718 meters (12,198 feet), is the highest point in Spain and the third highest volcano in the world, rising from its base on the ocean floor. The surrounding Teide National Park boasts an otherworldly landscape of volcanic craters, lava fields, and unique flora and fauna. A cable car ride to the top offers breathtaking views of the island and the Atlantic Ocean beyond. 🌋🚠
#travel#adventure#canaryislands
🇪🇸🇮🇨Spain says over 1,000 migrants reached its Canary Islands in 3 days as more attempt deadly crossing
More than 1,000 migrants from sub-Saharan countries arrived in Spain's Canary Islands in 18 boats over the past three days, Spain's marine rescue service said on Monday.
The archipelago off northwest Africa has seen a surge in migrant arrivals in recent weeks as more people from West Africa attempt to get their, which is a dangerous trip.
Officials say 7,270 migrants arrived in January, about as many as in the first six months of 2023.
Most of the boats depart from Mauritania. Spanish Prime Minister Pedro Sánchez and European Commission President Ursula von der Leyen will visit the West African country on Thursday to encourage authorities to try to curtail the departures.
#Spain#CanaryIslands
@africaintel
Drone drops food for dogs trapped in La Palma by volcano lava
Several emaciated dogs lie curled up in and around a walled, ash-covered yard cut off by volcanic lava in the mountainous area of Todoque, on the Spanish island of La Palma, until a drone appears in the sky to drop packages with food and water.
#CanaryIslands#LaPalma#volcano#Spain#News#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖
Sunspots seen in Spain as geomagnetic storm expected
Sunspots were seen from Spain's Canary Islands as a geomagnetic storm was expected to reach the Earth.
#Sunspots#Spain#CanaryIslands#GeomagneticStorm#News#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖
Red-hot lava forces evacuations in Spain's La Palma
Over 700 residents on the Spanish island of La Palma were ordered to abandon their homes as lava advanced toward their neighborhoods.
#LaPalma#Spain#volcano#CanaryIslands#CumbreVieja#News#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖
🐟 Rare Encounter with the “Sea Devil” near the Canary Islands!
For the first time in history, biologists managed to capture this mysterious deep-sea predator on video. Usually, only larvae or dead specimens are observed, as anglerfish live at extreme depths where almost no light reaches. But this time, the fish rose to the surface and appeared in front of the researchers’ camera — a truly unique observation for science!
#MarineLife#Anglerfish#DeepSeaMysteries#CanaryIslands☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot
Instagram | Facebook | Twitter | Sayt | Youtube.
Lava spews from La Palma volcano
The Cumbre Vieja volcano on Spain's La Palma island continues to spew lava and smoke.
#Volcano#LaPalma#Spain#Lava#CanaryIslands#CumbreVieja#News#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖
Volunteers take in La Palma's homeless pets
This makeshift shelter in La Palma, Spain, is housing hundreds of homeless pets after their owners were forced to flee from the Cumbre Vieja volcano.
#Volcano#LaPalma#Spain#Lava#CanaryIslands#CumbreVieja#HomelessPets#Pets#News#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖