3

I need a simple postcompile script to work, but i cant seem to get any script to work..

in my project.json i have the following:

"scripts": {
   "postcompile": "echo before building",
   "precompile": "echo after building"
}

but when i build, instead of the echo i get an error: No executable found matching command "echo"

it is the same for any other basic command like cd, dir, even cmd.
though dotnet pack works

what am i doing wrong?

Tomer W
  • 3,395
  • 2
  • 29
  • 44
  • Does it work if you do: `cmd.exe /c echo before building`? – Pawel Jan 30 '17 at 22:13
  • no, cmd doesnt work as well... though dotnet pack does. – Tomer W Jan 31 '17 at 03:57
  • "postcompile": "cmd /c echo postcompile" work – Alexandr Sulimov Feb 03 '17 at 19:22
  • For me, these all work find in `Visual Studio`'s build, but fails in `msbuild`, which is used by `Jenkins`. So everything passes developer testing, and then fails in auto-ci. – Jesse Chisholm Feb 09 '17 at 19:06
  • @TomerW did you solve this at some point? How? In a `prepublish` script I'd like to change to a sub-directory where Angular client app sits and then run some `npm run some-build-task` from there. – superjos Sep 07 '17 at 18:56
  • @superjos My original problem was that i had an extra (unwanted) folder win7-x64, I didn't actually solve this, I just stopped using the "platform". For matter of fact, I ended up neglecting .NET Core altogether and ported back to .NET FW. – Tomer W Sep 08 '17 at 08:15
  • :O thanks for your feedback. In the meantime, I discarded idea of changing directory, and ran npm from there taking advantage of its `--prefix some-sub-dir` option. – superjos Sep 08 '17 at 15:10

0 Answers0