diff --git a/CHANGELOG.md b/CHANGELOG.md index 3da3ceb..7b1478d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Pre-Release 1.0.1-beta (31 December, 2024) +* Minor bug fixes, see #5 + ## Pre-Release 1.0.0-beta (30 December, 2024) * Minor bug fixes * Moved the lockfile creation to the exclude folder to avoid write premission diff --git a/opt/mirrorsync/.version b/opt/mirrorsync/.version index 0aa8850..44b8614 100644 --- a/opt/mirrorsync/.version +++ b/opt/mirrorsync/.version @@ -1 +1 @@ -v1.0.0-beta \ No newline at end of file +v1.0.1-beta \ No newline at end of file diff --git a/opt/mirrorsync/mirrorsync.sh b/opt/mirrorsync/mirrorsync.sh index a3d14ae..96de9f0 100644 --- a/opt/mirrorsync/mirrorsync.sh +++ b/opt/mirrorsync/mirrorsync.sh @@ -279,11 +279,10 @@ do error "no local directory is defined in \"${repoconfig}\". Continuing with the next mirror" progresscounter=$((progresscounter+3)) continue - elif [ ! -w "$mirrordst" ]; then - error "The path \"${mirrordst}\" is not writable. Continuing with the next mirror" - progresscounter=$((progresscounter+3)) - continue - elif [ ! -d "$mirrordst" ]; then + fi + + # Check if directory exists, else create it + if [ ! -d "$mirrordst" ]; then warning "A local path for \"${mirrorname}\" does not exists, will create one" if [ ! mkdir "$mirrordst" 2>&1 ]; then error "The path \"${mirrordst}\" could not be created. Continuing with the next mirror" @@ -291,6 +290,13 @@ do continue fi fi + + # Validate that the current user can write to this path + if [ ! -w "$mirrordst" ]; then + error "The path \"${mirrordst}\" is not writable. Continuing with the next mirror" + progresscounter=$((progresscounter+3)) + continue + fi # Validate the remotes variable is a array is_array=$(declare -p remotes | grep '^declare -a')