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

Pre/Post restore script does not run #3436

Closed
dlebedynskyi opened this issue Jun 8, 2016 · 5 comments
Closed

Pre/Post restore script does not run #3436

dlebedynskyi opened this issue Jun 8, 2016 · 5 comments

Comments

@dlebedynskyi
Copy link

@dlebedynskyi dlebedynskyi commented Jun 8, 2016

Steps to reproduce

have a project.json file with

"scripts": {
        "postrestore": ["npm install"],

run dotnet restore

Expected behavior

npm install to run and node packages are restored. As it was before in RC1.

Actual behavior

npm install does not run no matter if you use prerestore, postrestore, npm install as an [] or not.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
@TheRealPiotrP

This comment has been minimized.

Copy link

@TheRealPiotrP TheRealPiotrP commented Jun 8, 2016

dotnet does not support pre/post-restore events. The extensibility model is going to undergo some redesign for RTM and this may become available in that timeframe.

@dlebedynskyi

This comment has been minimized.

Copy link
Author

@dlebedynskyi dlebedynskyi commented Jun 9, 2016

@piotrpMSFT how about documenting that for RC2? cause right now docs are misleading and project.json do has those in schema

@guardrex

This comment has been minimized.

Copy link

@guardrex guardrex commented Jun 23, 2016

@piotrpMSFT @blackdwarf I just ran into this. I need prerestore for my new and most excellent project.json to .csproj .NET Core tooling ... for goofballs who will want to go on working with a JSON project config file when we move to MSBuild. It actually 🎉 works! 🎉 ...

However, it will never work well if I can't trigger the tool to run prerestore. Is there a workaround? If not, why isn't this a higher priority? I have a feeling many devs will want to do pre/postrestore things.

Also, I agree with @dlebedynskyi ... The docs and schema for project.json say that pre/postrestore are there.

[EDIT] Here's the tooling that would require prerestore to work well: https://github.com/GuardRex/GuardRex.JsonToCsprojConverter

@dlebedynskyi

This comment has been minimized.

Copy link
Author

@dlebedynskyi dlebedynskyi commented Jun 24, 2016

@guardrex it is really disappointing that they broken this in RC2. thanks for tool thought.
For any dev that is used to npm as example this change is like shot in a leg from microsoft.
Wish they actually did prioritize this instead all closing issues.

@guardrex

This comment has been minimized.

Copy link

@guardrex guardrex commented Jun 24, 2016

@dlebedynskyi I'm surprised on this one.

I guess a workaround in my case is to put a Gulp watch on the project2.json test file so that when I mod the file, my console app is called to run, which will then immediately re-create the .csproj file.

At least I have a workaround, but I am a bit surprised that getting all of the script calls working for RTM wasn't a higher priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.