Skip to content

Make Config Directory Creation Explicit#148

Merged
fbsobreira merged 2 commits intomasterfrom
fix/init-config-file
Apr 27, 2025
Merged

Make Config Directory Creation Explicit#148
fbsobreira merged 2 commits intomasterfrom
fix/init-config-file

Conversation

@fbsobreira
Copy link
Owner

Description

This PR addresses an issue where the library attempts to create a directory on the local file system during initialization via the init() function. This causes errors in environments with a read-only file system.

The change replaces the init() function with an explicitly callable InitConfigDir() function. This gives consumers control over when (or whether) the directory is created. The InitConfigDir() is now only called where necessary (e.g., within ImportKeyStore), avoiding unintended side effects in read-only environments.

Fixes #147

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Ticket

TRON-147

How Has This Been Tested?

  • Manual tests (ran in both read-only and normal FS environments)
  • Unit tests (existing logic reused; no new tests)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

@vincentserpoul
Copy link

thank you! lgtm

@fbsobreira fbsobreira merged commit 96b87f5 into master Apr 27, 2025
3 checks passed
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.

importing the sdk triggers an init func that tries to create a file

2 participants