-
Notifications
You must be signed in to change notification settings - Fork 3
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 git pull issue and unwrap error #80
Conversation
Sandbox Executions |
Apply Sweep Rules to your PR? |
Important Auto Review SkippedBot user detected. To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChat with CodeRabbit Bot (
|
can you change the
|
🚀 Wrote ChangesDone. |
fluere-plugin/src/util.rs
Outdated
} | ||
Err(_) => { | ||
// If not running under sudo, just use the config_dir function as before | ||
// If not running under sudo, just use the cache_dir function as before | ||
cache_dir()? |
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.
error[E0277]: the ?
operator can only be used in a function that returns Result
or Option
(or another type that implements FromResidual
)
--> fluere-plugin/src/util.rs:24:24
|
7 | pub fn home_cache_path() -> PathBuf {
| ----------------------------------- this function should return Result
or Option
to accept ?
...
24 | cache_dir()?
| ^ cannot use the ?
operator in a function that returns PathBuf
|
= help: the trait FromResidual<Option<Infallible>>
is not implemented for PathBuf
For more information about this error, try rustc --explain E0277
.
error: could not compile fluere_plugin
(lib) due to previous error
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.
🚀 Wrote Changes
Done.
|
🚀 Wrote ChangesDone. |
|
🚀 Wrote ChangesDone. |
git pull was not able to pull the updated changes, |
🚀 Wrote ChangesDone. |
PR Feedback: 👎
Description
This PR addresses two issues. The first issue is the
git pull
command not working when updating the downloaded plugin. This was fixed by modifying the way thegit pull
command is executed in thedownload_plugin_from_github
function influere-plugin/src/downloader.rs
. Instead of concatenating thecd_cmd
andgit pull
commands, thecurrent_dir
method of theCommand
struct is used to change the working directory before executing thegit pull
command. TheCommand::new("bash")
calls were replaced withCommand::new("git")
and the arguments were adjusted accordingly.The second issue is a panic error on macOS related to the
unwrap()
function call influere-plugin/src/util.rs
. This was fixed by replacing theunwrap()
function call on thecache_dir()
function with the?
operator to propagate the error up the call stack.Summary of Changes
download_plugin_from_github
function influere-plugin/src/downloader.rs
to fix thegit pull
command issue.unwrap()
function call influere-plugin/src/util.rs
with the?
operator to fix the panic error on macOS.Fixes #69.
🎉 Latest improvements to Sweep:
rope
library to refactor Python! Check out Large Language Models are Bad at Refactoring Code. To have Sweep refactor your code, trysweep: Refactor <your_file>.py to be more modular
!💡 To get Sweep to edit this pull request, you can: