summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-03-23 19:12:33 +0100
committerCanop <cano.petrole@gmail.com>2022-03-23 19:12:33 +0100
commitf9fe6efebf3ce4e32d93705db8decc2019f7112f (patch)
tree370d4a08fa3685a247607d6329325e894669289f
parent2feccf9923eedafd64abcf48a59d277ce98fbda8 (diff)
escape spaces in sourcing path in shell script install
Fix #520 (hopefully, not really tested)
-rw-r--r--.gitignore1
-rw-r--r--src/cli/app_launch_args.rs1
-rw-r--r--src/shell_install/bash.rs3
3 files changed, 3 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 05a9b96..b34d908 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ deploy.sh
/trav
/press
/glassbench_*.db
+.bacon-locations
diff --git a/src/cli/app_launch_args.rs b/src/cli/app_launch_args.rs
index a1fe479..03b25ae 100644
--- a/src/cli/app_launch_args.rs
+++ b/src/cli/app_launch_args.rs
@@ -1,4 +1,3 @@
-
use {
crate::{
tree::TreeOptions,
diff --git a/src/shell_install/bash.rs b/src/shell_install/bash.rs
index e98dbc3..7be3b31 100644
--- a/src/shell_install/bash.rs
+++ b/src/shell_install/bash.rs
@@ -128,7 +128,8 @@ pub fn install(si: &mut ShellInstall) -> Result<(), ProgramError> {
si.skin.print_text(MD_NO_SOURCING);
return Ok(());
}
- let source_line = format!("source {}", &link_path.to_string_lossy());
+ let escaped_path = link_path.to_string_lossy().replace(' ', "\\ ");
+ let source_line = format!("source {}", &escaped_path);
for sourcing_path in &sourcing_paths {
let sourcing_path_str = sourcing_path.to_string_lossy();
if util::file_contains_line(sourcing_path, &source_line)? {