Skip to content

Commit

Permalink
Review script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Jan 9, 2025
1 parent 4f50a08 commit 3f6040f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/sync-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
# GNU General Public License for more details.
#

TARGET='s3:/profiles.cyberduck.io'
TARGET='s3:/profiles.cyberduck.io/'
DIRECTORY=$1
if [ ! $DIRECTORY ]; then
DIRECTORY=$(dirname "$(cd -P -- "$(dirname -- "$0")" && pwd -P)")
fi
echo "Finding profiles in $DIRECTORY"

# Upload changed profiles by comparing checksum
env "s3.metadata.default=Content-Type=application/xml" duck -y --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --existing compare --upload "$TARGET/" $DIRECTORY/*.cyberduckprofile
env "s3.metadata.default=Content-Type=application/xml" duck -y --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --existing compare --upload "$TARGET" $DIRECTORY/*.cyberduckprofile

# Delete profiles no longer maintained
duck -qy --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --list $TARGET/ |
duck -qy --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --list $TARGET |
while read name; do
[ -z "$name" ] && continue

if [ ! -f "$DIRECTORY/$name" ]; then
echo "Deleting $name"
duck -y --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --delete "$TARGET/$name"
duck -y --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --delete "$TARGET$name"
fi
done

duck -qy --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --purge "$TARGET/"
duck -qy --username $AWS_ACCESS_KEY_ID --password $AWS_SECRET_ACCESS_KEY --purge "$TARGET"

0 comments on commit 3f6040f

Please sign in to comment.