Мы используем 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
#Back Stronger And Better.🦾
Getting Back On Track After An Unsuccessful Losing Streak
Did you lose a huge amount of money in Forex trading and want to desperately win your trading losses back? Don't worry! This has happened to many traders before and there are people who have got back on track. Losing a huge fortune may appear to be an indication of the end of your Forex trading career but it doesn't have to be. Treat your previous losing streak as the greatest lesson that you have had and start all over again. The only thing you need to make sure is not to repeat the same mistakes that you have committed before.
Forex trading is a career that requires a good discipline, patience, emotional stability and hard work. When you loose a huge money for the first time, you might have done the trading blunders that new traders often make. If you are aware of those mistakes and ensure not to do them again, then no one can stop you from succeeding in Forex. But always keep in mind that success doesn't come overnight. It takes years and you have to accept this reality.
Below are few guided steps to pull your string back;
• Take a break to ensure that your mind is free from any regrets or other negative emotions, this will make you slowly unburden yourself from the past and give you the necessary courage and confidence to start trading again.
• Review the mistakes you did the last time, including lack of proper training, poor risk management, and poor emotional management. Make a list of beginner's mistakes in Forex and clearly understand how those mistakes can ruin a trading account... Check most of our previous articles for better understanding on some beginners mistakes so you can be properly guided.
• Refresh your knowledge in Forex, do demo trading and back testing for a few days and start with the small account first. Make sure that the account size gives you enough room to take risks, as you must never risk more than 2% of your capital. Once you start winning some trades, you will get a strong confidence.
FxSignals_Gold Team.