Skip to content
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

Allow user to specify the location of the json files for the extension #17

Closed
wants to merge 4 commits into from
Closed

Allow user to specify the location of the json files for the extension #17

wants to merge 4 commits into from

Conversation

MattBidewell
Copy link

@MattBidewell MattBidewell commented Oct 4, 2020

Fairly small PR. Issue 14

  • Added menu option in package.json (Any name changes just say!)
  • Get the settings from configuration.
  • Set the storage location to the storage location OR global storage location

Comment on lines -12 to +17
initializeStorageLocation(context.globalStoragePath);
const configuration = getConfiguration();

// if path is '', use global.
const storagePath = !configuration.saveLocation ? context.globalStoragePath : configuration.saveLocation;

initializeStorageLocation(storagePath);
Copy link
Owner

Choose a reason for hiding this comment

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

I think this might lead to some errors in the future. A better approach would be to change to have a global variable in configuration.ts that holds the global storage path. That would be initialized on activate.
With that, getAnnotationFilePath will actually query the configurations and check the configuration set by the user (in a way you already doing here).
This way, all manipulation is done only on configuration.ts, and nowhere else.
It's possible that the actual creation of the path might need to be done on getAnnotationFilePath.

What do you think?

Copy link
Author

Choose a reason for hiding this comment

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

Great shout!
I'll make the changes soon.

@thamara
Copy link
Owner

thamara commented Oct 14, 2020

Hi @MattBidewell, any updates on this?

@thamara thamara closed this Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants