From a9850e7e3f63643bd74ee10d36b78939372ddd20 Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Mon, 30 Jan 2023 17:57:14 +0800 Subject: [PATCH] set DFS_INITED and do not send login beacon if it was set --- .zshrc2 | 11 +++++++---- tools/test.zsh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.zshrc2 b/.zshrc2 index c79bf92..8526501 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -90,10 +90,12 @@ antigen apply # end of antigen config # beacon -if [[ "$EUID" == "0" ]]; then - "$DOTFILES/tools/common.sh" apost_beacon "sys.login.root" -else - "$DOTFILES/tools/common.sh" apost_beacon "sys.login.user" +if [[ -z "$DFS_INITED" && -z "$CI" ]]; then + if [[ "$EUID" == "0" ]]; then + "$DOTFILES/tools/common.sh" apost_beacon "sys.login.root" + else + "$DOTFILES/tools/common.sh" apost_beacon "sys.login.user" + fi fi # alias @@ -209,3 +211,4 @@ dfs() # clean unset i +export DFS_INITED=1 \ No newline at end of file diff --git a/tools/test.zsh b/tools/test.zsh index 23ccbbf..4deeac7 100644 --- a/tools/test.zsh +++ b/tools/test.zsh @@ -17,7 +17,7 @@ grep -q ".zshrc2" ~/.zshrc # check scripts and functions dfs version dfs log 1 -dfs beacon gh.ci +dfs beacon gh.ci $GITHUB_SHA z ~ test ~ -ef "$(pwd)" dogo