From 514524526617d686e9b8781ed4b9473e75f02911 Mon Sep 17 00:00:00 2001 From: Aleksandr Shushkov Date: Mon, 6 Dec 2021 20:52:59 +0300 Subject: [PATCH] Fix executes only export commands --- xcode/aux_scripts/install_env.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xcode/aux_scripts/install_env.sh b/xcode/aux_scripts/install_env.sh index d1c1fc0..c37fdaa 100644 --- a/xcode/aux_scripts/install_env.sh +++ b/xcode/aux_scripts/install_env.sh @@ -1,3 +1,5 @@ +#!/bin/sh + # Description: # Add user defined enviroment if programm not found # @@ -14,7 +16,21 @@ function source_home_file { file="$HOME/$1" - [[ -f "${file}" ]] && source "${file}" + + #echo $file + + if [[ -f "${file}" ]]; then + paathes="$(cat "${file}" | grep "^export PATH=")" + + while read paath + do + eval "$paath" + done <<< "$paathes" + else + return 1 + fi + + return 0 } # Use specific exec due to Xcode has custom value of $PATH