-
Notifications
You must be signed in to change notification settings - Fork 369
prefixed FileSystem locations with scriptcs_ #868
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
Conversation
|
in the migrate module, can you provide some output/feedback to the user what has happened? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do I now get to help? scriptcs -help only, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. If you muck up the command line with invalid args etc., you'll still get it too.
|
Regarding migration feedback, I initially wanted to do that, but MEF got the better of me and I couldn't, for the life of me, work out how to get an But anyway, I'm really doubting whether migrate should indeed be a module. See https://github.com/adamralph/scriptcs/commit/f452d43d6aabd165fe3bb9d28214d062f5193615#commitcomment-8926049 |
|
I don't think you can constructor inject into modules at the moment since it uses different container
I guess you could pass |
|
Regarding your comment, I am on the fence here, but if it's a module then it should be an external tool too, an opt-in, and not belong to a core. Each module is an extra cost to load, so I don't want it to be forced upon me if I don't need it. If I recall the reason for not introducing it as a switch was to not have a switch that would one day be taken away, but I am not sure how valid of an argument this is. |
|
@filipw thanks for the feedback. @scriptcs/core any other opinions on module vs command for migration? |
|
Why can't you constrictor inject? MEF support this.
|
|
I've no idea 😝, but if we decide that migrate should be a command then the point is moot, at least in this case. |
|
@scriptcs/core any other opinions on If a module, then we may need to do something about the UX. Currently our command line args are mix of commands disguised as options and actual options (we should really consider implementing #175) : Commands
Options
With the current design, the option to load the |
|
OK, I decided to make migration a command. There were just too many outstanding issues and questions around 'modules as commands' and making it a real command turned out to be far more straightforward and less disruptive. Yes, we may take away the migrate command somewhere down the line but I don't consider this a problem. This PR is far more straightforward now and the commit stream should be self explanatory. It also includes a full acceptance test for migration. The fix for #869 is no longer included here since it is irrelevant. I will send a separate PR for that issue. |
|
Builds are green. This PR is good to go again. |
|
Needs a rebase 😄 |
|
Done 😃 |
|
How will people know that they need to do this once their scripts break? Docs? Could we detect and run the migration if needed? Or is it too hard to detect? I.e. what if the user doesn't want to migrate existing packages.config etc.? |
|
I think we need to shout about it quite loudly, perhaps a post on http://blog.scriptcs.net/ and then we tweet it around etc, and/or cross post on other blogs owned by @scriptcs/core members. Detection isn't really possible since, in a given folder, we never know whether We need to make it clear in our announcements exactly what |
|
Alright |
prefixed FileSystem locations with scriptcs_
|
Hi @adamralph @khellang and I were just talking about this and we both share the concern about how this will break customers. I am worried also about the person who falls in between the cracks where the current migrate won't help them. Imagine I ran scriptcs within my full .NET app folder. Now you are migrating and moving my core app packages.config to the new scriptcs one. That may make scriptcs work but it breaks my .NET app as the packages.config is gone. Even if migrate worked, it is still ugly and non-intuitive as the user won't get a warning that would lead them to know to do migrate. So here's my suggestion.
By doing a copy instead of a move, we don't affect their existing app. Also going forward if they install new packages with scriptcs-install they will automatically go to the right place. The downside of this approach is the file copy will result in pulling in packages that may not be needed. One can always go manually and clean those out if they care. Thoughts? |
|
I really like this idea and I think it's better than what we currently have. I'll send a new PR which reverts the last two commits from this PR and adds what you've described. What about the other artifacts? I think we'll have to do the same for |
|
@adamralph great. For .cache it is safe to rename I think. |
|
One remaining question is where to put this code? I can very easily put it in scriptcs.exe, but what about hosting scenarios? Do we want to offer the ability for hosts to perform the same operation? If so, I'm not really sure where it would need to go. |
|
Also, if we do want to expose it for hosting, should it be implicit for anyone using the hosting layer or should it require an explicit invocation? |
|
I have most of the work done and I'll send a PR soon. The approach I have gone with is as follows: I've introduced first class types for migration, i.e.
Each The commands which perform migration are: script execution, REPL, Before sending the PR, I'm going to add acceptance tests for If anyone has any comments on the approach, now is the time 😉. |
fixes #626