-
Notifications
You must be signed in to change notification settings - Fork 634
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
DYN-7409: Properly use the userData CLI parameter #15558
base: master
Are you sure you want to change the base?
Conversation
Fall back to default if no preferences file present.
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7409
UI Smoke TestsTest: success. 11 passed, 0 failed. |
PathManager.Instance.AssignHostPathAndIPathResolver(string.Empty, pathResolver); | ||
|
||
if (!File.Exists(PathManager.Instance.PreferenceFilePath)) |
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.
will this traverse the newly set user data folder from the command line args and check for a prefs file there?
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.
Yes. If userData
parameter is, e.g. %appData%\Dynamo\Dynamo Revit
, PathManager.Instance.PreferenceFilePath
is %appData%\Dynamo\Dynamo Revit\3.4\DynamoSettings.xml
.
can you say a bit more about this: |
Added some detail in the description, let me know if it's still unclear. I'm struggling a bit to figure out how to test this. I can make a test which starts a separate CLI process with the |
@twastvedt I can't think of anything great as is, you could introduce something to the exec session like pref path and then create a graph to return that? |
Updated the PR description to use the PR template, feel free to merge |
Haven't had a chance to get to tests for this, I converted to draft for now, might be a bit. |
Purpose
Fixes the following bug:
The
userData
CLI argument seems to intend to set the user data directory, but the value passed is only used for loading packages, not for loading the preferences file. Preferences are still loaded from the default "Dynamo Core" folder.When running the CLI, the Preferences singleton first gets initialized here, using the PathResolver created the line above, which is constructed without the userData folder from the cli args. Only a few lines later, when calling StartDynamoWithDefaultConfig, is the userData cli arg used, but by then Preferences has already been initialized.
This PR modifies the initial PathResolver above to make use of the
userData
parameter. If the preferences file does not exist at theuserData
folder it falls back to using the default user data folder for preferences (preserving current behavior).Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Fix a bug with setting preferences file location via
userdata
parameter in CLI.Reviewers
@mjkkirschner
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of