1
0
mirror of https://github.com/pgrondek/config.git synced 2024-11-22 03:53:43 +00:00
config/sanitaze-folders.sh

43 lines
1.2 KiB
Bash
Raw Normal View History

2019-05-06 15:43:23 +00:00
#!/bin/bash
2020-03-04 13:47:54 +00:00
#set -x
set -e
shopt -s dotglob nullglob
if [[ -d "${HOME}/Pobrane" && ! -L "${HOME}/Pobrane" ]]
2019-05-06 15:43:23 +00:00
then
mkdir -p "${HOME}/Downloads"
mv ${HOME}/Pobrane/* "${HOME}/Downloads"
echo "Moved all download srom ${HOME}/Pobrane to ${HOME}/Downloads"
rmdir "${HOME}/Pobrane"
ln -s "${HOME}/Downloads" "${HOME}/Pobrane"
echo "Symlinked ${HOME}/Pobrane to ${HOME}/Downloads"
else
2020-03-04 13:47:54 +00:00
if [[ -L "${HOME}/Pobrane" ]]
2019-05-06 15:43:23 +00:00
then
echo "Nothing to do ${HOME}/Pobrane is already symlink"
else
ln -s "${HOME}/Downloads" "${HOME}/Pobrane"
echo "Symlinked ${HOME}/Pobrane to ${HOME}/Downloads"
fi
fi
2020-03-04 13:47:54 +00:00
if [[ -d "${HOME}/Dokumenty" && ! -L "${HOME}/Dokumenty" ]]
then
mkdir -p "${HOME}/Documents"
mv ${HOME}/Dokumenty/* "${HOME}/Documents" || true
echo "Moved all download srom ${HOME}/Dokumenty to ${HOME}/Documents"
rmdir "${HOME}/Dokumenty"
ln -s "${HOME}/Documents" "${HOME}/Dokumenty"
echo "Symlinked ${HOME}/Dokumenty to ${HOME}/Documents"
else
if [[ -L "${HOME}/Dokumenty" ]]
then
echo "Nothing to do ${HOME}/Dokumenty is already symlink"
else
ln -s "${HOME}/Documents" "${HOME}/Dokumenty"
echo "Symlinked ${HOME}/Dokumenty to ${HOME}/Documents"
fi
fi