<ahref="https://github.com/ihatethefrench"><imgsrc="https://img.shields.io/badge/Maintainer-@not%2D-my%2D-segfault-brightgreen"alt=The maintainer of this repository" href="https://github.com/not-my-segfault"></a><br>
<ahref="https://github.com/not-my-segfault"><imgsrc="https://img.shields.io/badge/Maintainer-@not%2D-my%2D-segfault-brightgreen"alt="The maintainer of this repository" href="https://github.com/not-my-segfault"></a><br>
/// Searches the filesystem for .pacnew files and helps the user deal with them.
pubfndetect(){
// Start spinner
letsp=spinner!("Scanning for pacnew files");
@ -25,29 +25,30 @@ pub fn detect() {
}
// If pacnew files are found, warn the user and prompt to pacdiff
if!pacnew.is_empty(){
sp.stop_bold("It appears that at least one program you have installed / upgraded has installed a .pacnew/.pacsave config file. These are created when you have modified a program's configuration, and a package upgrade could not automatically merge the new file.");
ifpacnew.is_empty(){
sp.stop_bold("No pacnew files found");
}else{
sp.stop_bold("It appears that at least one program you have installed / upgraded has installed a .pacnew config file. These are created when you have modified a program's configuration, and a package upgrade could not automatically merge the new file.");
letchoice=prompt!(defaultfalse,"Would you like to run pacdiff to deal with this? You can always deal with this later by running `sudo pacdiff`");
letchoice=prompt!(defaultfalse,"Would you like Amethyst to run pacdiff to deal with this? You can always deal with this later by running `sudo pacdiff`");
warn!("Pacdiff uses vimdiff by default to edit files for merging. You can focus panes by mousing over them and pressing left click, and scroll up and down using your mouse's scroll wheel (or the arrow keys). To exit vimdiff, press the following key combination: ESC, :qa!, ENTER");
warn!("You can surpress this warning in the future by setting the `PACDIFF_WARNING` environment variable to `0`");
letcont=prompt!(defaultfalse,"Continue?");
ifcont{
letconfig=config::read();
ifconfig.base.pacdiff_warn{
ShellCommand::pacdiff()
.elevated()
.wait()
.silent_unwrap(AppExitCode::PacmanError);
}
}else{
warn!("Pacdiff uses vimdiff by default to edit files for merging. You can focus panes by mousing over them and pressing left click, and scroll up and down using your mouse's scroll wheel (or the arrow keys). To exit vimdiff, press the following key combination: ESC, :qa!, ENTER");
warn!("You can surpress this warning in the future by setting `pacdiff_warn` to \"false\" in ~/.config/ame/config.toml");
info!("Generating shell completions for {}. Please pipe `stderr` to a file to get completions as a file, e.g. `ame gencomp fish 2> file.fish`",gencomp_args.shell);
letp0=prompt!(defaultfalse,"Would you like to review and/or edit {}'s PKGBUILD (and any adjacent build files if present)?",pkg);
ifp0{
info!("This will drop you into a standard `bash` shell (unless set otherwise in the config) in the package's cache directory. If any changes are made, you will be prompted whether to save them to your home directory. To stop reviewing/editing, just run `exit`");
crash!(AppExitCode::Other,"Could not remove cache directory at {}: {}. This could be a permissions issue with fakeroot, try running `sudo rm -rf {}`",cachedir,e,cachedir)