flofreud / posh-gvm

GVM for Powershell
Apache License 2.0
210 stars 60 forks source link

Provide symlink to .gvm for compatiblity with gvm #4

Closed jbaruch closed 9 years ago

jbaruch commented 9 years ago

.gvm folder is used by tools as kind of a "contract" of gvm. It would be nice if those tools could use posh-gvm as well :)

flofreud commented 9 years ago

Out of interest: which tools are actively looking for the .gvm folder? eg for Eclipse and Intellij I normally select gvm-installations by hand.

The symlink is not complicated to achive, but I have to consider the following:

Probably I could change the installation script and add an additional Install.ps1 for PsGet installations for asking the user if he wants the symlink or we put the necessary command in the readme?!

I'm not sure what the best solution could be, but if you can give me examples for the such tools, it could be easier to decide this.

Without further dependencies and check the following code would create the symlink:

Invoke-Expression -Command "cmd.exe /c mklink /J '$env:USERPROFILE\.gvm' '$env:USERPROFILE\.posh_gvm'"

Possible solutions:

  1. Setup symlink without asking if not .gvm folder.
  2. Setup symlink without asking and removing of the .gvm folder.
  3. Changing posh-gvm to be 'compatible' to the bash-gvm folder in a way which does not clash (at least against a current version). This would need a different name for current-candidate-version symlink.
  4. Extending README with explanation about usecase and the command above.
jbaruch commented 9 years ago

OK, plural was an overstatement :) I am trying to use https://github.com/noamt/sgvm with posh-gvm.

flofreud commented 9 years ago

SGVM doesn't use the the symlinks inside of the .gvm dir and therefore could be used with the .posh_gvm dir.

But for meta-data it use the same structure like bash-gvm. Probably I was not one of my better choices to change it, but I wanted to put all meta-data into one location. Therefore it would change the structure of the posh_gvm dir, if used to install new versions. Currently there would be done no harm, so it would be possible.

SGVM, which is normally used in CI environment, itself is able to install version by so posh-gvm isn't really needed, right? Could it be that your single aim is to reuse already available packages in a development environment for a CI system? If it is that, wouldn't the documentation of this possibility solve this special usecase only relevant for a really small group of users?

I don't really like the named side-effects and solution 3 would be too time consuming considering the currently little gain.

If you are currently developing a tool for general usage on a dev machine, it would be a probable a different answer but currently I would lean towards solution 4.

jbaruch commented 9 years ago

You are probably right. If the meta-data is different, it will be easier to document this corner-case in SGVM then trying to work around it in posh-gvm, so please disregard.

Keep up the good work!

flofreud commented 9 years ago

If this is getting more important I could try to find the time to get the meta-data inter-operable. Honestly didn't see this usecase coming and regret the decision. What's done is done. I currently have no time slot for changing the meta-data handling correctly.

jbaruch commented 9 years ago

That's fine. A well documented single call to mklink is not a big deal.