cleanup WDOTD
This commit is contained in:
parent
c6d3098290
commit
d4c7138667
1 changed files with 16 additions and 6 deletions
|
@ -95,15 +95,25 @@ fi
|
|||
# Create and link Work-Dir of the Day
|
||||
|
||||
if [ $(id -u) -ne 0 ]; then
|
||||
WDOTD=$(date "+${HOME}/archive/work/%Y/%m/work_%Y%m%d")
|
||||
ARCHIVSUBPATH="archive/work"
|
||||
ARCHIVPATH="${HOME}/${ARCHIVSUBPATH}"
|
||||
WDOTD=$(date "+${ARCHIVPATH}/%Y/%m/work_%Y%m%d")
|
||||
WORKDIR="${HOME}/Work"
|
||||
[ -e $WDOTD ] || mkdir -pv "${WDOTD}" >>${MYSHELLCONFIG_LOGFILE}
|
||||
if [[ ( -e "${HOME}/Work" && -h "${HOME}/Work" ) || ! -e "${HOME}/Work" ]] ; then
|
||||
ln -svnf "${WDOTD}" "${HOME}/Work" >>${MYSHELLCONFIG_LOGFILE}
|
||||
alias gowork='cd "${HOME}/Work"'
|
||||
if [[ ( -e "${WORKDIR}" && -h "${WORKDIR}" ) || ! -e "${WORKDIR}" ]] ; then
|
||||
ln -svnf "${WDOTD}" "${WORKDIR}" >>${MYSHELLCONFIG_LOGFILE}
|
||||
alias gowork='cd "${WORKDIR}"'
|
||||
else
|
||||
echo "${HOME}/Work exists and is real directory" |tee -a ${MYSHELLCONFIG_LOGFILE} 2>&1
|
||||
alias gowork='echo "~/Work is not confiugurable, see ${MYSHELLCONFIG_LOGFILE}'
|
||||
echo "${WORKDIR} exists and is real directory" |tee -a ${MYSHELLCONFIG_LOGFILE} 2>&1
|
||||
alias gowork='echo "${WORKDIR} is not configurable, see ${MYSHELLCONFIG_LOGFILE}'
|
||||
fi
|
||||
|
||||
for i in $(find ${ARCHIVPATH} -type d); do
|
||||
if [ ! "$(ls -A $i)" ]; then
|
||||
echo "DIR $i is empty -> remove it"
|
||||
echo rm -rf "$i"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue