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
core: rename data dir environment var #1014
Conversation
Note: we can't safely land this until the mac app and windows installer are updated. Maybe that should happen in this same PR. |
This is based on a conversation @dominic and I had earlier today. |
I think that the installers should set that environment variable in this PR, too. (I also want to change the Postgres data directory for the windows installer, but I haven't gotten around to it yet.) |
Existing change LGTM, but it would be nice to get the Mac app change in here as well. [edit] I'll aim to push that in here today. |
rebased |
@@ -15,6 +15,10 @@ class ChainCore: NSObject { | |||
return "postgres://localhost:\(dbPort)/core?sslmode=disable" | |||
} | |||
|
|||
var homeDir: String { | |||
return NSProcessInfo().environment["HOME"] + "/Library/Application Support/Chain Core" |
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.
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.
I like this, but we've also got https://developer.apple.com/reference/foundation/1413045-nshomedirectory
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.
(We're not sandboxed, but it's probably safest if we ever manage that path.)
Mac LGTM. I had to delete the existing
|
This change serves three goals: - Rename the env var to CHAIN_CORE_DATA - Rename the default location to $HOME/.chaincore - Leave overriding the location to platform-specific tooling. For the last item specifically, the Mac app and the Windows installer will explicitly set CHAIN_CORE_DATA to platform-specific values such as '~/Library/Application Support/Chain Core'.
This change serves two goals:
tooling.
For the second item, the Mac OS X app explicitly sets
CHAIN_CORE_DATA to the appropriate location for
Mac OS X (as opposed to plain Darwin).
Future work: also update the Windows installer.