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: issue getting config.yaml path when main.dart is accessed globally #243

Merged
merged 3 commits into from
Oct 18, 2022

Conversation

srieteja
Copy link
Contributor

@srieteja srieteja commented Oct 16, 2022

- What I did
Due to dart AOT compilation, the config file path cannot be asserted during runtime. This PR has changes to the methods that get the config Yaml that ensure that the config file path can be accessed during runtime.

- How I did it

  • added a new method _getConfigFile() that gets the package path during runtime using "Isolate.resolvePackageUri"
  • using the package root path to resolve the config.yaml file path
  • the above methods need to be run asynchronously, for that introduced an init method in ConfigUtil class
  • this init method is called from the bin/main.dart

- How to verify it
running the bin/main.dart file from any system path should work without throwing errors (provided all the valid args are declared)

- Description for the changelog

  • fix: ensure that config.yaml can be reached when programs are executed globally

@srieteja srieteja requested a review from cpswan October 16, 2022 21:28
@srieteja srieteja self-assigned this Oct 16, 2022
@srieteja srieteja linked an issue Oct 16, 2022 that may be closed by this pull request
@srieteja srieteja merged commit b6fb0db into trunk Oct 18, 2022
@srieteja srieteja deleted the getAbsoluteConfigPath branch October 18, 2022 10:29
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.

at_cli fails with unhandled exception
2 participants