mgear-dev / mgear_dist

mGear v.3.x.x distribution repository
http://www.mgear-framework.com/
MIT License
184 stars 53 forks source link

- append to Maya.env file instead of overwriting. #61

Closed JaschaW closed 3 years ago

JaschaW commented 3 years ago

The code was indeed writing over any information that the users would have, a small change to the code, instead of write, we append, if the file does not exist, it will create it and append as well.

miquelcampos commented 3 years ago

@JaschaW I have a question.

If we update mGear version with the drag and drop install, will it add the mGear data again on the Maya.env?

JaschaW commented 3 years ago

Hey @miquelcampos,

Very good question. Something I did not consider. Looking deeper into this, I think there is also a flaw that if the user has a MAYA_MODULE_PATH defined, it will not take that into account and create another line with that, it will start messing things up a bit in that regard.

To your question about the update of mGear, nothing is pointing to versions. As an example, if I define a path, the installer unpacks the contents of the installation into that path, it is up to the user to maybe put into a correct version that might be using? I think this was intended to be very general initially, but can maybe take a more defined approach going forward?

Examples of the user paths that they do manually and the installer will copy contents into these folders. If there were an upgrade and the user wants to use the drag and drop installer, we would then need the code to check if the paths are the same and only append to the MAYA_MODULE_PATH if they are not?

Custom path: C:/Users/user/Documents/mgear_custom_path

Custom path with version: C:/Users/user/Documents/mgear_custom_path/mgear_3.7.9

miquelcampos commented 3 years ago

my question was just about adding lines to exiting maya.env So if we already installed one time mGear with drag and drop, next time will add again the same line to the existing ones not to track mGear version I think the people using drag and drop install will not have/want several mGear versions

about the MAYA_MODULE_PATH I not sure 100% about the syntax but I think there is a way to add to the existing MGEAR_MODULE_PATH = C:/Users/user/Documents/mgear_custom_path MAYA_MODULE_PATH=%MGEAR_MODULE_PATH%

so instead of override will add

JaschaW commented 3 years ago

Thanks, @miquelcampos I am with you. I will need to address that functionality, it currently will just append a new path regardless. I will add in some logic that will check if there is a module path, and add to it, also will check if there is that path already added.

I am also not 100% sure, but I do know that it the syntax for working within the .bat, .env files. I currently use that for my "home pipeline". Will double check and see how I can make use of that. Thanks man!

miquelcampos commented 3 years ago

@JaschaW thanks to you!

JaschaW commented 3 years ago

Hey @miquelcampos, I made a new commit in this same branch. Not sure if Github pings you for that, so just making sure you are aware!

miquelcampos commented 3 years ago

@JaschaW I am doing the update manually, is easier that solve the complex merge. Not sure why, probable we did too many changes since the PR was creater closing this and doing the commit here https://github.com/mgear-dev/mgear_dist/issues/62

JaschaW commented 3 years ago

Thanks @miquelcampos, I did add in a few extra merges to fix some mistakes I spotted. I will keep it simple for future merges! :)

miquelcampos commented 3 years ago

@JaschaW now worries :) to be honest I was thinking in changes I did to the repository, not your PR updates ;)