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

Add -cwd option to change working directory when app starts #40

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

AKuHAK
Copy link
Contributor

@AKuHAK AKuHAK commented Oct 9, 2024

Added -cwd option for those cases when neutrino at start has no access to cwd. This also require to move system.toml parser after argument parser, so now system.toml is stronger then arguments

@rickgaiser
Copy link
Owner

A fallback path is a workaround for broken loaders. It will also make neutrino less deterministic.

Perhaps a parameter can be added to neutrino to choose another CWD? Like -cwd=mc0:/neutrino/. In that case the user is always in control of what config is used from what location.

@AKuHAK
Copy link
Contributor Author

AKuHAK commented Oct 13, 2024

@rickgaiser this will require more changes, as argument parser should be moved before toml parser in that case, thus making arguments stronger than cfg. Also no need for additional argument, we can chdir if -cfg option is present and if not present load from default cwd. The only downside you will loose 2 toml files simultaneous support (system + user-defined combination). Or it is possible to load system driver (from ./) after user cfg regardless if user cfg was successfully loaded or not.

@AKuHAK AKuHAK changed the title Added a hardcoded fallback path Add -cwd option to change working directory when app starts Oct 13, 2024
@AKuHAK AKuHAK marked this pull request as draft October 18, 2024 07:53
@AKuHAK AKuHAK marked this pull request as ready for review October 19, 2024 07:03
@AKuHAK
Copy link
Contributor Author

AKuHAK commented Oct 19, 2024

@rickgaiser pr is ready for review

Copy link
Owner

@rickgaiser rickgaiser left a comment

Choose a reason for hiding this comment

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

Lgtm, if you change the 1 typo then I will merge.

README.md Outdated Show resolved Hide resolved
@AKuHAK
Copy link
Contributor Author

AKuHAK commented Oct 19, 2024

done

@rickgaiser rickgaiser merged commit 19a4f1b into rickgaiser:master Oct 19, 2024
4 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.

2 participants