You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let sed_debug_command = Command::new(&self.options.sed_path)
51
+
let sed_debug_command = Command::new(path_to_be_used)
47
52
.args(&constructed_cmd_line)
48
53
.stdin(Stdio::null())
49
54
.stdout(Stdio::piped())
50
55
.stderr(Stdio::inherit())
51
56
.output()
52
57
.ok()
53
58
.ok_or(
54
-
format!("Sed failed to process your script. Are you using GNU sed? If so, please report the bug.\nINFO: Sed was called using \"{} {}\"",&self.options.sed_path, constructed_cmd_line.join(" ")),
59
+
format!("[Error] Sed failed to start. Are you using GNU sed? Is the path correct?\n[Info] Sed was called using \"{} {}\"",&path_to_be_used, constructed_cmd_line.join(" ")),
55
60
)?
56
61
.stdout;
57
62
58
63
ifself.options.debug{
59
64
eprintln!(
60
-
"[Info] Called sed with \"{} {}\"",
61
-
self.options.sed_path,
62
-
constructed_cmd_line.join(" ")
65
+
"[Info] Called sed with \"{} {}\", which returned {} lines of output.",
66
+
path_to_be_used,
67
+
constructed_cmd_line.join(" "),
68
+
sed_debug_command.len()
63
69
);
64
70
}
65
71
72
+
// If sed returned no output (so it failed) and sed
"[Info] Sed failed and didn't return any output. As sed path wasn't specified, trying again with \"gsed\". If even that won't work, make sure \
80
+
sed is able to process your script. Most common mistake is forgeting to use -E."
81
+
);
82
+
}
83
+
returnself.get_sed_output();
84
+
}
85
+
66
86
Ok(String::from_utf8(sed_debug_command).ok().ok_or(String::from("String received from sed doesn't seem to be UTF-8. If this continues to happen, please report the bug."))?)
0 commit comments