Made packages.config path configurable from NuGet preferences by popara96 · Pull Request #551 · GlitchEnzo/NuGetForUnity (original) (raw)

@popara96

Minor changes in order to make packages.config path configurable. We don't allow for the path to be outside of Assets folder since we still need OnPostprocessAllAssets to be triggered if this file is changed.

@popara96

@popara96

@popara96

…the user manually entered an invalid path in NuGet.config file

igor84

@JoC0de

igor84

igor84

Comment on lines +46 to +47

relativeTo = Path.GetFullPath(relativeTo);
path = Path.GetFullPath(path);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should probably only accept full paths and not call GetFullPath on them. If someone passed relative paths to it this would not work correctly if called from CLI version since CurrentDirectory and project path set through the argument could be different. We could throw or return path if Path.IsPathRooted returned false for any of them.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI can use Directory.SetCurrentDirectory(projectPath); to get the same behavior.

JoC0de

igor84

@JoC0de

@popara96

…nfig file's directory by default

@popara96

popara96

popara96

@popara96

JoC0de

@popara96

…fig file path is outside of Assets instead of logging

igor84

JoC0de

JoC0de

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that much changes. Together we are getting a nice solution. 👍

@popara96

JoC0de

@popara96

JoC0de

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can merge 👍

@popara96 popara96 deleted the configurable-config-path branch

August 11, 2023 08:50

@popara96

Thank you for the thorough review @JoC0de !

@JoC0de

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})