From 599434a4be4aea38871ad0a19dad9460df07f82e Mon Sep 17 00:00:00 2001 From: liuyx Date: Tue, 10 Oct 2023 11:23:51 +0800 Subject: [PATCH] fix(alias): add source env to install-alias --- install-alias.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install-alias.sh b/install-alias.sh index 5d827cd..34a5579 100755 --- a/install-alias.sh +++ b/install-alias.sh @@ -13,7 +13,8 @@ _check() { case "$_continue" in y | Y) # 如果输入 y 或 Y,则用 sed 命令删除 source $alias_init_file 这一行 - awk '!/source "$alias_init_file"/' "$rc_file" > tmpfile && mv tmpfile "$rc_file" + awk '!/source "$alias_init_file"/' "$rc_file" > tmpfile \ + && mv tmpfile "$rc_file" echo "##### 覆盖 source $alias_init_file ######" ;; *) @@ -28,6 +29,7 @@ _check() { _install() { rsync -a --backup --suffix=.bak ./alias.d "$HOME/" + echo "source $alias_init_file" >> "$rc_file" echo "###### install success, enjoy it! #####" source "$alias_init_file" }