mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
feat: fix relative path executables
This commit is contained in:
parent
abed3be3ee
commit
dee9cde334
1 changed files with 9 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ use crate::{shell, suggestions};
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use inquire::*;
|
use inquire::*;
|
||||||
use pay_respects_utils::evals::best_match_path;
|
use pay_respects_utils::evals::best_match_path;
|
||||||
|
use pay_respects_utils::files::get_best_match_file;
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
|
|
@ -66,7 +67,13 @@ pub fn cnf(data: &mut Data) {
|
||||||
executable
|
executable
|
||||||
);
|
);
|
||||||
|
|
||||||
let best_match = best_match_path(executable, &data.executables);
|
let best_match = {
|
||||||
|
if executable.contains(std::path::MAIN_SEPARATOR) {
|
||||||
|
get_best_match_file(executable)
|
||||||
|
} else {
|
||||||
|
best_match_path(executable, &data.executables)
|
||||||
|
}
|
||||||
|
};
|
||||||
if best_match.is_some() {
|
if best_match.is_some() {
|
||||||
let best_match = best_match.unwrap();
|
let best_match = best_match.unwrap();
|
||||||
split_command[0] = best_match;
|
split_command[0] = best_match;
|
||||||
|
|
@ -149,6 +156,7 @@ pub fn cnf(data: &mut Data) {
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
data.update_error(None);
|
data.update_error(None);
|
||||||
suggestion(data);
|
suggestion(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue