I have some build, test, etc scripts written in various interpreted languages but in Windows Powershell or cmd you cannot invoke a script directly from the command line.
# Rather than
./build
# On Windows I have to specify
python .\build
Obviously in *nix you can mark something as executable with chmod +x ./build
and use a shebang to select the interpreter - something unavailable in Windows.
This is frustrating to some extent because I would like to keep the calling of said scripts consistent. Previously I used make
as it has a release for Windows, that way I could specify the interpreter within the makefile:
# Works in MacOS, Windows, Linux
make build
# makefile
.PHONY: build
build:
go run ./.scripts/build.go
But the installation of make
is a little cumbersome on Windows and I believe it's unmaintained. It's difficult to pass arguments to the target command and the keyword also doesn't always make sense where you might specify a task, rather than a command to "make" something, like
make run-http-server
make run-hot-reload-web
Is there a modern task runner that is cross platform, maintained, easy to install and with a command keyword that make sense in the context of running commands?
e.g.
run-task hot-reload --flag
rt hot-reload --flag
bash
can help you.python script.py
in all platforms, both Windows and Linux work correctly, as long as python is in the path.