From 92cd214de3dcaafed53074bd8a83477d44425b0f Mon Sep 17 00:00:00 2001 From: xvzc Date: Sat, 6 Jan 2024 21:06:55 +0900 Subject: [PATCH] update init_private_resources --- dot_scripts/executable_git-set | 39 ++++++++++++++++------------------ dot_zshrc | 2 ++ init_private_resources.sh | 17 +++++---------- install.sh | 4 ++-- 4 files changed, 27 insertions(+), 35 deletions(-) diff --git a/dot_scripts/executable_git-set b/dot_scripts/executable_git-set index f5ed83e..b9c08d8 100644 --- a/dot_scripts/executable_git-set +++ b/dot_scripts/executable_git-set @@ -3,34 +3,31 @@ HELP="usage: git set --user [username]" while [[ $# -gt 0 ]]; do - case $1 in - -u|--user) - git_user="$2" - shift - shift - ;; - -h|--help) - shift - echo $HELP - exit 1 - ;; - *) - shift # past argument - ;; - esac + case $1 in + -u | --user) + git_user="$2" + shift + shift + ;; + -h | --help) + shift + echo $HELP + exit 1 + ;; + *) + shift # past argument + ;; + esac done if [ -z "$git_user" ]; then - echo $HELP - exit 1; + echo $HELP + exit 1 fi # https://github.com/xvzc/dotfiles.git origin=$(git remote get-url origin) tokens=($(echo $origin | tr "/" "\n")) -repo=${tokens[${#tokens[@]}-1]} -echo $git_user -echo $repo +repo=${tokens[${#tokens[@]} - 1]} git remote set-url --push origin "git@$git_user.github.com:$git_user/$repo" - diff --git a/dot_zshrc b/dot_zshrc index 95a3e3b..f074573 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -37,3 +37,5 @@ zmodload zsh/zprof prompt pure + +[ "$TMUX" = "" ] && (tns main || tat main) || return 0 diff --git a/init_private_resources.sh b/init_private_resources.sh index fe50d1f..d1eee05 100755 --- a/init_private_resources.sh +++ b/init_private_resources.sh @@ -5,26 +5,19 @@ error() { exit 1 } -wait-1password() { +check-1password() { if ! command -v op &>/dev/null; then error "1Password not found" fi if ! op whoami 2>/dev/null; then - echo "Login 1password app" open -a 1Password - - until op signin 2>/dev/null; do - sleep 1 - done + error "Login 1password app" fi if ! ssh-add -l &>/dev/null; then - echo "Setup 1password ssh-agent" - - until ssh-add -l &>/dev/null; do - sleep 1 - done + open -a 1Password + error "Setup 1password ssh-agent" fi } @@ -45,7 +38,7 @@ elif [ "$cur_os" = "Linux" ]; then font_dir=~/.local/share/fonts/ fi -wait-1password +check-1password op read "op://Personal/SSH Github xvzc/public key" >~/.ssh/xvzc.pub && chmod 600 ~/.ssh/xvzc.pub diff --git a/install.sh b/install.sh index a59cad9..93c4dc3 100755 --- a/install.sh +++ b/install.sh @@ -97,5 +97,5 @@ else error "Cannot determine operating system." fi -# install pynvim -pip3 install pynvim +bob install nightly +bob use nightly