From f20280620aaf21a82666d1cbbf798f40b06cf629 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 6 Oct 2021 10:49:08 +0000 Subject: [PATCH] fix syntax error in bash_profile (#20385) if there is no newline at the end of the file, this export is glued to the rest of the code and generates a syntax error like this ```bash if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash fiexport PATH="/Users/user/.local/share/solana/install/active_release/bin:$PATH" ``` (cherry picked from commit 87c0d8d9e73d3ca3e168473b39dcc92ce352500c) Co-authored-by: OleG --- install/src/command.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/src/command.rs b/install/src/command.rs index efe7d7bc0e..164a7b6377 100644 --- a/install/src/command.rs +++ b/install/src/command.rs @@ -436,7 +436,7 @@ fn add_to_path(new_path: &str) -> bool { #[cfg(unix)] fn add_to_path(new_path: &str) -> bool { - let shell_export_string = format!(r#"export PATH="{}:$PATH""#, new_path); + let shell_export_string = format!("\nexport PATH=\"{}:$PATH\"", new_path); let mut modified_rcfiles = false; // Look for sh, bash, and zsh rc files