Signed-off-by: Hu XueJiao 1034502035@qq.com --- sbin/set-env.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/sbin/set-env.sh b/sbin/set-env.sh index a8b161fa..18024e1a 100644 --- a/sbin/set-env.sh +++ b/sbin/set-env.sh @@ -2,10 +2,16 @@
. lib/env.sh
-write_shellrc() +write_shell_profile() { - echo "export LKP_SRC=$PWD" >> $(shell_profile) - echo "export PATH=$PATH:$LKP_SRC/sbin:$LKP_SRC/bin" >> $(shell_profile) + if [ $# -gt 0 ]; then + echo $@ >> $(shell_profile) + else + echo "export LKP_SRC=$PWD" >> $(shell_profile) + echo "export PATH=$PATH:$LKP_SRC/sbin:$LKP_SRC/bin" >> $(shell_profile) + fi + + source $(shell_profile) }
write_host() @@ -28,5 +34,5 @@ write_host() EOF }
-write_shellrc +write_shell_profile write_host