removed std err pipe
This commit is contained in:
parent
91e7f9acca
commit
360f8c42cc
1 changed files with 16 additions and 21 deletions
37
src/app.rs
37
src/app.rs
|
|
@ -41,7 +41,19 @@ use notify_debouncer_full::{
|
||||||
};
|
};
|
||||||
use slotmap::Key as SlotMapKey;
|
use slotmap::Key as SlotMapKey;
|
||||||
use std::{
|
use std::{
|
||||||
any::TypeId, collections::{BTreeMap, HashMap, HashSet, VecDeque}, env, ffi::OsStr, fmt, fs, future::pending, io::{BufRead, BufReader}, num::NonZeroU16, os::unix::fs::PermissionsExt, path::PathBuf, process, sync::{Arc, Mutex}, time::{self, Instant}
|
any::TypeId,
|
||||||
|
collections::{BTreeMap, HashMap, HashSet, VecDeque},
|
||||||
|
env,
|
||||||
|
ffi::OsStr,
|
||||||
|
fmt, fs,
|
||||||
|
future::pending,
|
||||||
|
io::{BufRead, BufReader},
|
||||||
|
num::NonZeroU16,
|
||||||
|
os::unix::fs::PermissionsExt,
|
||||||
|
path::PathBuf,
|
||||||
|
process,
|
||||||
|
sync::{Arc, Mutex},
|
||||||
|
time::{self, Instant},
|
||||||
};
|
};
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use trash::TrashItem;
|
use trash::TrashItem;
|
||||||
|
|
@ -2351,28 +2363,11 @@ impl Application for App {
|
||||||
.permissions();
|
.permissions();
|
||||||
// Set the executable permission to the file
|
// Set the executable permission to the file
|
||||||
perms.set_mode(0o755);
|
perms.set_mode(0o755);
|
||||||
fs::set_permissions(&path, perms).expect("Failed to set permissions");
|
fs::set_permissions(&path, perms)
|
||||||
|
.expect("Failed to set permissions");
|
||||||
|
|
||||||
log::info!("running app: {:?}", ext);
|
log::info!("running app: {:?}", ext);
|
||||||
let cmd = std::process::Command::new(path).spawn();
|
let _ = std::process::Command::new(path).spawn();
|
||||||
match cmd {
|
|
||||||
Ok(mut res) => {
|
|
||||||
if let Some(stderr) = res.stderr.take() {
|
|
||||||
let reader = BufReader::new(stderr);
|
|
||||||
for line in reader.lines() {
|
|
||||||
if let Ok(line) = line {
|
|
||||||
log::error!(
|
|
||||||
"running app error: {}",
|
|
||||||
line
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(error) => {
|
|
||||||
log::error!("error: {:?}", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => match open::that_detached(&path) {
|
_ => match open::that_detached(&path) {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue