Correct full-pull-only-once login logic

Problem was that $current_date was overridden during the `source .zshrc` call.
This commit is contained in:
Sage Vaillancourt 2024-07-21 12:17:17 -04:00
parent 68dce8e419
commit 04614599f5
1 changed files with 11 additions and 5 deletions

View File

@ -1,11 +1,17 @@
date >> "$HOME/.tmp/getdot-log" logfile="$HOME/.tmp/getdot-log"
echo "~/zlogin, babyyy" >> "$HOME/.tmp/getdot-log" # date >> "$logfile"
# echo "~/zlogin, babyyy" >> "$logfile"
LOGIN_SYNC_DATE="$HOME/.bin/.login-dot-sync" LOGIN_SYNC_DATE="$HOME/.bin/.login-dot-sync"
touch $LOGIN_SYNC_DATE touch $LOGIN_SYNC_DATE
current_date="$(date '+%D')" login_sync_date="$(date '+%D')"
if [[ "$current_date" != "$(cat "$LOGIN_SYNC_DATE")" ]]; then logged_date="$(cat "$LOGIN_SYNC_DATE")"
if [[ "$login_sync_date" == "$logged_date" ]]; then
GETDOT_ARGS="--skip-dconf" source "$HOME/.zshrc"
else
RUN_GETDOT="true" GETDOT_ARGS="--skip-dconf" source "$HOME/.zshrc" RUN_GETDOT="true" GETDOT_ARGS="--skip-dconf" source "$HOME/.zshrc"
fi fi
echo "$current_date" > "$LOGIN_SYNC_DATE"
echo "$login_sync_date" > "$LOGIN_SYNC_DATE"