-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat:non-path-discovery for modules #59
Conversation
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.
👍 Looks good to me! Reviewed everything up to a505652 in 14 seconds
More details
- Looked at
154
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. src-tauri/src/manager.rs:330
- Draft comment:
Consider refactoring the code that adds the discovery path to the PATH variable into a helper function to avoid duplication. This is applicable in both the Unix and Windows implementations ofget_modules_in_path
. - Reason this comment was not posted:
Confidence changes required:50%
The code for adding the discovery path to the PATH variable is duplicated for both Unix and Windows. This can be refactored into a helper function to avoid code duplication and improve maintainability.
2. src-tauri/src/manager.rs:347
- Draft comment:
Usingunwrap_or_default
when joining paths can hide potential errors. Consider handling the error explicitly to understand why joining paths might fail. - Reason this comment was not posted:
Confidence changes required:50%
Theunwrap_or_default
usage when joining paths can hide potential errors. It's better to handle the error explicitly to understand why joining paths might fail.
3. src-tauri/src/manager.rs:391
- Draft comment:
Usingunwrap_or_default
when joining paths can hide potential errors. Consider handling the error explicitly to understand why joining paths might fail. This is also applicable in the Unix implementation. - Reason this comment was not posted:
Confidence changes required:50%
The same issue of usingunwrap_or_default
when joining paths is present in the Windows implementation as well. It should be addressed similarly.
4. src-tauri/src/lib.rs:197
- Draft comment:
Usingunwrap_or_default
when getting the discovery path can hide potential errors. Consider handling the error explicitly to understand why getting the path might fail. - Reason this comment was not posted:
Confidence changes required:50%
Theunwrap_or_default
usage when getting the discovery path can hide potential errors. It's better to handle the error explicitly to understand why getting the path might fail.
Workflow ID: wflow_wBhgZPqLwqpEIvvk
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
a505652
to
15c65ac
Compare
@ErikBjare any suggestions about this? |
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.
Yes this looks good to me :)
src-tauri/src/manager.rs
Outdated
|
||
// Add discovery path if not already in PATH | ||
if !paths.contains(&config.defaults.discovery_path) { | ||
paths.push(config.defaults.discovery_path.to_owned()); |
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.
This should be pushed to the front of the list so that it has priority (following PATH-lookup behavior).
src-tauri/src/manager.rs
Outdated
@@ -330,29 +330,42 @@ fn start_module_thread(name: String, custom_args: Option<Vec<String>>, tx: Sende | |||
#[cfg(unix)] | |||
fn get_modules_in_path() -> BTreeSet<String> { | |||
let excluded = ["awk", "aw-tauri", "aw-client", "aw-cli"]; |
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.
Add aw-qt?
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.
Will do!
15c65ac
to
6a709ce
Compare
Users can set their own discovery_path for modules.
#40
Important
Add custom
discovery_path
for module discovery, integrated intoDefaults
andget_modules_in_path()
for Unix and Windows.discovery_path
for modules inDefaults
inlib.rs
.discovery_path
is added to the systemPATH
for module discovery inget_modules_in_path()
inmanager.rs
.discovery_path
field toDefaults
struct inlib.rs
.discovery_path
set to~/aw-modules
on Unix andC:\Users\<username>\aw-modules
on Windows.get_modules_in_path()
inmanager.rs
now includesdiscovery_path
in the search paths for modules on both Unix and Windows.This description was created by for a505652. It will automatically update as commits are pushed.