Closed sweep-ai[bot] closed 10 months ago
[!IMPORTANT]
Auto Review Skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai review
command.
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?
can you change the util.rs
code based on this code?
fn home_config_path() -> PathBuf {
// Check for the SUDO_USER environment variable
let sudo_user = env::var("SUDO_USER");
let path_base = match sudo_user {
Ok(user) => {
// on macOS just return the config_dir()
if env::consts::OS == "macos" {
config_dir().expect("Could not determine the home directory")
} else {
// If SUDO_USER is set, construct the path using the user's home directory
let user_home = format!("/home/{}", user);
Path::new(&user_home).join(".config")
}
}
Err(_) => {
// If not running under sudo, just use the config_dir function as before
config_dir().expect("Could not determine the home directory")
}
};
let path_config = path_base.join("fluere");
path_config
}
Done.
PR Feedback (click)
Description
This PR addresses two issues. The first issue is the
git pull
operation on a downloaded plugin not working. The second issue is a panic error on macOS due to anunwrap()
call on aResult
that is anErr
value.Summary of Changes
download_plugin_from_github
function influere-plugin/src/downloader.rs
to handle any errors that may occur during the execution of thegit pull
command. If the command fails, an error message indicating that thegit pull
operation failed is returned.unwrap()
call on theResult
in thehome_cache_path
function influere-plugin/src/util.rs
with amatch
statement to handle theErr
value. If theResult
is anErr
, an error message indicating that the operation is not supported by the OS is returned. This prevents the program from panicking when the operation is not supported.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: