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

fix(config): config path ignores actual app path #891

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Nov 13, 2024

☑️ Resolves

  • Config path ignores the app name:
    • Production and Dev instances share the same config file
    • Multi-account instances share the same config
  • Config is supposed to app's data directory, which depends on the name (executable)
  • However, it didn't work:
    • Constant with the path was defined on the module-level
    • Module is executed on require/import before app.setName() was called and name was set
  • Fix: get the name only on config load, not on module import

@ShGKme ShGKme added bug Something isn't working 3. to review labels Nov 13, 2024
@ShGKme ShGKme self-assigned this Nov 13, 2024
@@ -120,6 +131,7 @@ async function writeAppConfigFile(config: Partial<AppConfig>) {
* Load the application config into the application memory
*/
export async function loadAppConfig() {
console.log(getAppConfigFilePath())
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme force-pushed the fix/config-file-path branch from bf3bddf to 0f59c3d Compare November 13, 2024 17:51
@ShGKme ShGKme enabled auto-merge November 13, 2024 17:51
@ShGKme ShGKme merged commit 9cb8fb0 into main Nov 13, 2024
10 checks passed
@ShGKme ShGKme deleted the fix/config-file-path branch November 13, 2024 17:52
@ShGKme ShGKme mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants