Skip to content

Commit

Permalink
fmk - adding sh script to zip all for zenodo
Browse files Browse the repository at this point in the history
  • Loading branch information
fmckenna committed Apr 18, 2024
1 parent 057bcaf commit 4ab6c37
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions zipAll.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# remove currrent zip files
rm *.zip

# Loop through each directory in the current directory
for dir in */; do
# Remove trailing slash
dir=${dir%/}

# Check if it's a directory
if [ -d "$dir" ]; then
# Create a zip file with the same name as the directory
zip -r "${dir}.zip" "$dir"
echo "Zipped $dir"
fi
done

echo "All folders in the current directory zipped successfully"

0 comments on commit 4ab6c37

Please sign in to comment.