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

Local settings folder for portable app #656

Closed
ivysrono opened this issue Mar 16, 2020 · 12 comments · Fixed by #671
Closed

Local settings folder for portable app #656

ivysrono opened this issue Mar 16, 2020 · 12 comments · Fixed by #671

Comments

@ivysrono
Copy link
Contributor

After we reinstall the system, or when we use Sabaki between several different computers, we want a file to record the settings modified by the user. The content of this file is equal to settings.json, but has higher permissions. LizGoban, Firefox and other open source projects provide this feature.

@ivysrono ivysrono changed the title Provide user settings profile feature request: Provide user settings file Mar 16, 2020
@yishn
Copy link
Member

yishn commented Mar 16, 2020

Why not just use settings.json?

@ivysrono
Copy link
Contributor Author

First, it can be modified once and used everywhere;
Second, settings.json may be modified during major version updates, and a separate user configuration file can avoid version conflicts.

@yishn
Copy link
Member

yishn commented Mar 16, 2020

settings.json can also be used everywhere. If there's need to modify settings during an upgrade, this would also have to affect your custom settings file.

@ivysrono
Copy link
Contributor Author

emm, settings.json is hard to store and sync. Could we custom it's path?

@yishn
Copy link
Member

yishn commented Mar 16, 2020

How does Firefox support changing the settings path?

@ivysrono
Copy link
Contributor Author

ivysrono commented Mar 17, 2020

User.js file - MozillaZine Knowledge Base
1.1 Overview · ghacksuserjs/ghacks-user.js Wiki

There are more disadvantages of direct sync settings.json:
For example, as #586 has not been resolved, users may need to customize the width and height, but their settings may not apply to another computer.

LizGoban support config.json to set engines, path, and so on.

I would like to put config.json into the same folder as sabaki-**-portable.exe, to get realy portable.

@yishn
Copy link
Member

yishn commented Mar 17, 2020

Maybe for the portable version, say path\to\sabaki-**-portable.exe, we will resolve the settings folder as path\to\sabaki-profile, and for non-portable, it stays at %APPDATA%\Sabaki.

@ivysrono
Copy link
Contributor Author

IMO, it is ok.

@yishn
Copy link
Member

yishn commented Mar 17, 2020

Would you like to submit a PR? We set the setting folder path in setting.js, line 7.

@ivysrono
Copy link
Contributor Author

I'll try the next few days.

@yishn yishn changed the title feature request: Provide user settings file feature request: Local settings folder for portable app Mar 17, 2020
@yishn yishn changed the title feature request: Local settings folder for portable app Local settings folder for portable app Mar 17, 2020
@ivysrono
Copy link
Contributor Author

Would you like to submit a PR? We set the setting folder path in setting.js, line 7.

Why sabaki always use sync function?
Could we use async?
Or node-fs-extra which is depended by electron?

@yishn
Copy link
Member

yishn commented Mar 22, 2020

Because we are not a server, we don’t need to serve multiple users at the same time, it’s not that critical to use async functions. Also, it simplifies control flow and removes the need to show a busy indicator in the UI.

@yishn yishn linked a pull request Mar 22, 2020 that will close this issue
yishn pushed a commit that referenced this issue Mar 22, 2020
* Local settings folder for portable app 

#656

* Update setting.js

https://stackoverflow.com/a/46647041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants