Мы используем 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
🎄 Do you know how to respond when an English speaker wishes you a merry Christmas?’ Try this quiz - we’ll tell you the answer later! Are there any other ways you could respond? 🤶
[Image: Getty]
EXTRA: This festive season, we're sharing some of our own stories about Christmas and New Year. Link in bio.
#learnenglish#english#bbclearningenglish
😊 The next time you're feeling 'happy', try using one of these synonyms instead and boost your vocabulary! ✍️ See if you can use one of them in the comments.
Note: not all the words are perfect synonyms. Pay attention to the context and grammar.
MORE: Is happiness the key to success? 🔎 Find out in this episode of 6 Minute English. Click on the link in our bio.
#englishlesson#englishwords#englishvocabulary#english#bbclearningenglish
🍱🥘🍲 The next time you eat something delicious, try using one of these synonyms instead and boost your vocabulary! ✍️ See if you can use one of them in the comments.
Note: not all the words are perfect synonyms. Pay attention to the context and grammar.
🎧 MORE: Click on the link in our bio to listen to a 6 Minute English box set on the topic of food.
#englishlesson#englishwords#englishvocabulary#english#bbclearningenglish
🚀 Take your English vocabulary to the next level by learning these alternatives to ‘less than’! Can you use one in a sentence - and do you know any more?
👀 Note: these words may not be exact synonyms - pay attention to the context.
#englishlesson#englishwords#englishvocabulary#english#bbclearningenglish#englishteacher#lessthan
🤢😔 Everybody gets sick from time to time… so we made a vocabulary table with useful sickness-related English for you to learn, use, and share with a friend! 😄
Do you know any more English vocabulary related to illness? 👇
#englishvocabulary#learnenglish#englishphrases#britishenglish#EFL#ESL#ELT#vocab#bbclearningenglish
😱 Lots of animal species are at risk of extinction. 🐘🦁🦒Can you choose the correct word to fill the gap? We’ll tell you the correct answer later! (Image: Getty)
#environment#extinction#extinct#earth#animals#learnenglish#bbclearningenglish#vocab#englishquiz
Here are 5 linkers that you can add to your conversation to make it flow better and sound more fluent!
1) To be honest – I’m going to give my opinion (even if it’s insulting!)
2) Actually – to correct information or say something surprising
3) Mind you – I’ve just thought of something that contrasts what I was saying
4) By the way – I’m going to introduce a new topic I’ve just remembered
5) Anyway – I’m going to finish the conversation or change topic now
Add them to your conversations to help them flow! Which one is your favourite?
#learnenglish#speakenglish#vocabulary#bbclearningenglish#britishenglish#formalenglish#linkers#naturalenglish#nativespeakerenglish#conversationskills#ncoversationalenglish
❓❓❓Do you know how to respond when an English speaker asks ‘Is the post office open today?’ 🏣Try this quiz - we’ll tell you the answer later! Are there any other ways you could respond?👇👇👇
[Image: Getty]
#learnenglish#socialenglish#correctresponse#englishquiz#english#englishvocabulary#learnenglish#englishphrases#contraction#question#shortanswer#britishenglish#EFL#ESL#ELT#vocab#bbclearningenglish