// If pacnew files are found, warn the user and prompt to pacdiff
// If pacnew files are found, warn the user and prompt to pacdiff
if!pacnew.is_empty(){
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.");
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 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{
ShellCommand::pacdiff()
ShellCommand::pacdiff()
.elevated()
.elevated()
.wait()
.wait()
.silent_unwrap(AppExitCode::PacmanError);
.silent_unwrap(AppExitCode::PacmanError);
}
}else{
}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 the `PACDIFF_WARNING` environment variable to `0`");