Merge pull request #494 from fosslinux/cd-helpers-sh

Handle files correctly that start with a dash
This commit is contained in:
Andrius Štikonas 2025-01-19 01:34:20 +00:00 committed by GitHub
commit 0fa2f1e5ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,8 +31,8 @@ _get_files() {
for f in ${fs}; do
# Archive symlinks to directories as symlinks
echo "${prefix}/${f}"
if [ -d "${f}" ] && ! [ -h "${f}" ]; then
cd "${f}"
if [ -d "./${f}" ] && ! [ -h "./${f}" ]; then
cd "./${f}"
_get_files "${prefix}/${f}"
cd ..
fi
@ -54,9 +54,9 @@ reset_timestamp() {
fs="${fs} $(echo .[0-z]*)"
fi
for f in ${fs}; do
touch -h -t 197001010000.00 "${f}"
if [ -d "${f}" ]; then
cd "${f}"
touch -h -t 197001010000.00 "./${f}"
if [ -d "./${f}" ]; then
cd "./${f}"
reset_timestamp
cd ..
fi