Skip to content

Commit eb6e2b0

Browse files
src: cli: Fix path expansion
1 parent 7024015 commit eb6e2b0

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/cli/manager.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,23 @@ pub fn mavlink_connection_string() -> String {
156156
}
157157

158158
pub fn log_path() -> String {
159-
MANAGER
160-
.clap_matches
161-
.log_path
162-
.clone()
163-
.expect("Clap arg \"log-path\" should always be \"Some(_)\" because of the default value.")
159+
let log_path =
160+
MANAGER.clap_matches.log_path.clone().expect(
161+
"Clap arg \"log-path\" should always be \"Some(_)\" because of the default value.",
162+
);
163+
164+
shellexpand::full(&log_path)
165+
.expect("Failed to expand path")
166+
.to_string()
164167
}
165168

166169
// Return the desired settings file
167170
pub fn settings_file() -> String {
168-
MANAGER.clap_matches.settings_file.clone()
171+
let settings_file = MANAGER.clap_matches.settings_file.clone();
172+
173+
shellexpand::full(&settings_file)
174+
.expect("Failed to expand path")
175+
.to_string()
169176
}
170177

171178
// Return the desired address for the REST API

0 commit comments

Comments
 (0)