cd back to current dir after copying skeleton

This commit is contained in:
Niklas Holm
2018-02-14 09:59:22 +01:00
parent 000e81ffcb
commit 032e31971f

View File

@@ -227,14 +227,16 @@ maybe_create_home ()
echo
echo "They will never be overwritten nor automatically updated."
echo
local cur_pwd="$PWD"
cd /etc/skel || echo "WARNING: Failed attempt to cd into /etc/skel!"
local f=
/usr/bin/find . -type f | while read f; do
local fDest=${f#.}
local fDest="${f#.}"
if [ ! -e "${HOME}${fDest}" -a ! -L "${HOME}${fDest}" ]; then
/usr/bin/install -D -p -v "${f}" "${HOME}/${fDest}"
/usr/bin/install -D -p -v "${f}" "${HOME}${fDest}"
fi
done
cd "${cur_pwd}"
else
echo "${HOME} could not be created."
{ [ -d "${TEMP}" ] && HOME="${TEMP}"; } ||