go-task / task

A task runner / simpler Make alternative written in Go
https://taskfile.dev
MIT License
11.57k stars 618 forks source link

Windows 10 - "sleep": executable file not found in $PATH #305

Closed testautomation closed 4 years ago

testautomation commented 4 years ago

Task version: 2.8.0 OS: Windows 10 64 bit

error:

echo ... staring EHRbase server ...
... staring EHRbase server ...
java -jar ../application/target/application-0.11.0.jar --cache.enabled=false > log &
sleep 20
"sleep": executable file not found in $PATH
task: Failed to run task "start": task: Failed to run task "starteb": exit status 127

example task

starteb:
        cmds:
          - echo ... starting EHRbase server ...
          - java -jar ../application/target/application-0.11.0.jar --cache.enabled=false > log &
          - sleep 20
          - echo ... EHRbase server started.

additional information

sleep is not supported by Window's cmd.exe

image

but works in PowerShell

image

task command was executed in "Windows Terminal (Preview)" which uses PowerShell under the hood - not cmd.exe

andreynering commented 4 years ago

Hi @testautomation,

What happens is that the sleep builtin is not implemented on the shell interpreter Task uses, so it unfortunately won't work on Windows for now (which doesn't have a proper executable called sleep available).

I'm closing this as a duplicate of #197.

For more information see https://github.com/mvdan/sh/issues/93 and https://github.com/mvdan/sh/issues/97.