2

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
2
  • Maybe bash can help you. May 21, 2022 at 12:09
  • You can simply use python script.py in all platforms, both Windows and Linux work correctly, as long as python is in the path.
    – Alejandro
    Oct 25, 2022 at 14:07

1 Answer 1

2

This is a very late answer and it is doubtful it is still useful for you, but while looking for an answer to this question myself, I encountered go-task

Alternatively, installing Make with Chocolatey could be an option and not at all cumbersome.

2
  • 1
    Please post more info such as your experience with it and what is good about it. Oct 25, 2022 at 18:40
  • Here's a better link: taskfile.dev
    – Clintm
    Mar 27 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.