local/bin/homeinit: Use USER_NAME variable

master
Pierre Neidhardt 2019-01-29 10:16:00 +01:00
parent f31868b783
commit 6fb97bfcb3
1 changed files with 6 additions and 5 deletions

View File

@ -8,6 +8,7 @@ HTTPS_ROOT=https://gitlab.com/
SSH_ROOT=git@gitlab.com:
ROOT=$HTTPS_ROOT
PROFILE=/tmp/homeinit-$USER/homeinit
USER_NAME=Ambrevar
[ -z "$SOURCEDIR" ] && SOURCEDIR="$HOME/personal"
[ -z "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME="$HOME/.config"
@ -127,12 +128,12 @@ EOF
if [ -e "$SOURCEDIR" ]; then
git -C "$SOURCEDIR" pull
else
git clone ${SSH_ROOT}Ambrevar/personal ~/personal
git clone ${SSH_ROOT}$USER_NAME/personal ~/personal
fi
if [ -e ~/.password-store ]; then
git -C ~/.password-store pull
else
git clone ${SSH_ROOT}Ambrevar/password-store ~/.password-store
git clone ${SSH_ROOT}$USER_NAME/password-store ~/.password-store
## The following is necessary to make sure the 'diff' GPG filter is properly set up.
pass git init
fi
@ -147,10 +148,10 @@ done
section "dotfiles"
if [ -e ~/dotfiles ]; then
git -C ~/dotfiles remote set-url origin ${ROOT}Ambrevar/dotfiles
git -C ~/dotfiles remote set-url origin ${ROOT}$USER_NAME/dotfiles
git -C ~/dotfiles pull
else
git clone ${ROOT}Ambrevar/dotfiles ~/dotfiles || exit 1
git clone ${ROOT}$USER_NAME/dotfiles ~/dotfiles || exit 1
fi
pushd ~/dotfiles
## .bash_profile may prevent .profile from being parsed, so we move it.
@ -291,8 +292,8 @@ if inpath guix; then
rm -rv "$(dirname "$PROFILE")"
fi
section "locate db"
if [ -x ~/.local/bin/updatedb-local ]; then
section "locate db"
~/.local/bin/updatedb-local
fi