remove old WDOTD-configuration

This commit is contained in:
Jakobus Schürz 2020-02-11 16:13:14 +01:00
parent 489363c8b2
commit b1016acdb6
3 changed files with 33 additions and 33 deletions

View file

@ -30,8 +30,8 @@ create_symlinks() {
ln -sf "${MYSHELLCONFIG_BASE}/tmux" ~/.tmux
ln -sf "${MYSHELLCONFIG_BASE}/tmux/tmux.conf" ~/.tmux.conf
mkdir -pv ~/.config/systemd/user/default.target.wants
ln -sf "${MYSHELLCONFIG_BASE}/systemd/workdir.service" ~/.config/systemd/user/default.target.wants/workdir.service
ln -sf "${MYSHELLCONFIG_BASE}/systemd/workdir.service" ~/.config/systemd/user/workdir.service
#ln -sf "${MYSHELLCONFIG_BASE}/systemd/workdir.service" ~/.config/systemd/user/default.target.wants/workdir.service
#ln -sf "${MYSHELLCONFIG_BASE}/systemd/workdir.service" ~/.config/systemd/user/workdir.service
# Configure to use githooks in .githooks, not in standardlocation .git/hooks
$SGIT config core.hooksPath .githooks
@ -39,8 +39,8 @@ create_symlinks() {
# don't know, why i do it here. TODO: Check it
find .git/hooks -type l -exec rm {} \; && find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;
systemctl --user daemon-reload
systemctl --user restart workdir.service
#systemctl --user daemon-reload
#systemctl --user restart workdir.service
cd ~-
}

View file

@ -94,34 +94,34 @@ fi
# Create and link Work-Dir of the Day
if [ $(id -u) -ne 0 ]; then
ARCHIVSUBPATH="archive/work"
ARCHIVPATH="${HOME}/${ARCHIVSUBPATH}"
WDOTD=$(date "+${ARCHIVPATH}/%Y/%m/work_%Y%m%d")
WORKDIR="${HOME}/Work"
# First cleanup all empty Archivdirectories for workdir
for i in $(find ${ARCHIVPATH} -maxdepth 3 -type d |grep -v "$WDOTD" ); do
if [ ! "$(ls -A $i)" ]; then
echo "DIR $i is empty -> remove it" >&2
rm -vr "$i" 2>&1 |tee -a ${MYSHELLCONFIG_LOGFILE} >&2
fi
done
# Create workdir of the day, if not existing
[ -e $WDOTD ] || mkdir -pv "${WDOTD}" >>${MYSHELLCONFIG_LOGFILE}
# Link $WORKDIR to $WDOTD and set alias
if [[ ( -e "${WORKDIR}" && -h "${WORKDIR}" ) || ! -e "${WORKDIR}" ]] ; then
ln -svnf "${WDOTD}" "${WORKDIR}" >>${MYSHELLCONFIG_LOGFILE}
alias gowork='cd "${WORKDIR}"'
else
echo "${WORKDIR} exists and is real directory" |tee -a ${MYSHELLCONFIG_LOGFILE} 2>&1
alias gowork='echo "${WORKDIR} is not configurable, see ${MYSHELLCONFIG_LOGFILE}'
fi
unset ARCHIVPATH ARCHIVSUBPATH
fi
#if [ $(id -u) -ne 0 ]; then
# ARCHIVSUBPATH="archive/work"
# ARCHIVPATH="${HOME}/${ARCHIVSUBPATH}"
# WDOTD=$(date "+${ARCHIVPATH}/%Y/%m/work_%Y%m%d")
# WORKDIR="${HOME}/Work"
#
# # First cleanup all empty Archivdirectories for workdir
# for i in $(find ${ARCHIVPATH} -maxdepth 3 -type d |grep -v "$WDOTD" ); do
# if [ ! "$(ls -A $i)" ]; then
# echo "DIR $i is empty -> remove it" >&2
# rm -vr "$i" 2>&1 |tee -a ${MYSHELLCONFIG_LOGFILE} >&2
# fi
# done
#
# # Create workdir of the day, if not existing
# [ -e $WDOTD ] || mkdir -pv "${WDOTD}" >>${MYSHELLCONFIG_LOGFILE}
#
# # Link $WORKDIR to $WDOTD and set alias
# if [[ ( -e "${WORKDIR}" && -h "${WORKDIR}" ) || ! -e "${WORKDIR}" ]] ; then
# ln -svnf "${WDOTD}" "${WORKDIR}" >>${MYSHELLCONFIG_LOGFILE}
# alias gowork='cd "${WORKDIR}"'
# else
# echo "${WORKDIR} exists and is real directory" |tee -a ${MYSHELLCONFIG_LOGFILE} 2>&1
# alias gowork='echo "${WORKDIR} is not configurable, see ${MYSHELLCONFIG_LOGFILE}'
# fi
#
# unset ARCHIVPATH ARCHIVSUBPATH
#fi

@ -1 +1 @@
Subproject commit abdbe70d7fb57dda3186fe1184f30a6511be01d8
Subproject commit 6665aadb5ba6cafd556c8b7101a14276019ceb9e