" was unexpected at this time. on a cmd line block inside gradle script

Viewed 30

I am checking if a particular file has been used up by any other process for read/Write. I have a build.gradle which has 2 tasks, and inside one of the task, we have a exec block containing the following code:

exec {
            ignoreExitValue true
            executable "cmd"
            args "/c cd workspace/${project}/conf && @echo off && 2^>nul (>>${dependenciesFile} echo off) && (echo file is not locked) || (echo file is locked)"
}

I end up getting the following error :

" was unexpected at this time.

What could be the source of errore here?

0 Answers
Related