Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : Processing post-creation actions... The system cannot find the file specified #36

Closed
mtnrbq opened this issue Feb 20, 2018 · 10 comments

Comments

@mtnrbq
Copy link

mtnrbq commented Feb 20, 2018

When executing in PowerShell on Windows 10, in the post-creation actions I receive the error : The system cannot find the file specified.
In the template.json, there is the following in the postActions section:

"condition": "(OS != \"windows\")",

The only reference I've found to checking OS versions is dotnet/templating which has:

"condition": "(OperatingSystemKind == \"Linux\")"

Not sure if the condition is not firing, and allowing the action to try and run the chmod action

Happy to do a PR with some clarification if I've misunderstood what's going on here

@theimowski
Copy link
Member

@rmunn ideas?

@theimowski
Copy link
Member

#34

@rmunn
Copy link
Contributor

rmunn commented Feb 20, 2018

I copied that almost verbatim from @mlorbetske's code in dotnet/templating#1042, and didn't have a Windows system to test on so I assumed that the OS != "Windows" condition was correct. But looking at this bit of the dotnet-templating code, it looks like the OS variable in that condition should instead be OperatingSystemKind. Try making that change and see if that fixes it on Windows. (I can't test the change myself).

Or perhaps @mlorbetske will know what the right syntax should be here.

@theimowski
Copy link
Member

Neither OperatingSystemKind nor OS works for me..
Let's wait and see if @mlorbetske could help here, otherwise I'll need to revert this change

@rmunn
Copy link
Contributor

rmunn commented Feb 20, 2018

That particular post-action specifically runs the Unix chmod command, so it's supposed to only run on Linux and OS X. So it would be really nice if the dotnet templating docs would actually document this OperatingSystemKind parameter here.

Also, maybe try OperatingSystemKind == \"Linux\" || OperatingSystemKind == \"Mac\". See if that condition works.

@theimowski
Copy link
Member

OperatingSystemKind == \"Linux\" || OperatingSystemKind == \"Mac\" doesn't trigger for Win, but it also doesn't trigger for Linux Subsystem on Win.

Looks like none of OperatingSystemKind or OS variables are present in any OS

@rmunn
Copy link
Contributor

rmunn commented Feb 20, 2018

Sigh... if we can't find a way to make that post-action only trigger on Linux/OS X, you'll have to revert this change, and I'll have to track down the three other PRs I made to other templates and revert them as well. Annoying.

Maybe someone at Microsoft will respond to dotnet/templating#1421 and tell us how to actually do what we're trying to do (trigger a post-action only on Linux or OS X), and then we'll be able to revert the reversion and actually have a runnable build.sh. Here's hoping.

@theimowski
Copy link
Member

Reverting the change for now

theimowski added a commit that referenced this issue Feb 20, 2018
@rmunn
Copy link
Contributor

rmunn commented Feb 23, 2018

If the condition is changed to "(OS != \"Windows_NT\")" (see dotnet/templating#1421 (comment)) does that prevent it from running on a Windows machine? I don't have a Windows machine available at the moment to test that, though I'll have one again on Monday.

@theimowski
Copy link
Member

Fixed by #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants