fixed inconsistent naming on change_endings, tossed out old script for finding bad
[feisty_meow.git] / scripts / files / zip_directories.sh
1 #!/bin/bash
2
3 # goes through the current directory (currently) and zips up any directories
4 # into an archive with the same name as the directory plus a time stamp.
5
6 source $FEISTY_MEOW_SCRIPTS/core/functions.sh
7
8 #hmmm: take a dir parameter to go to for this.
9 dir=.
10
11 function flattenizer()
12 {
13   while read dirname; do
14     if [ ! -z "$dirname" ]; then
15       echo "flattening directory '$dirname'..."
16       zip -rm "${dirname}_$(date_stringer)" "$dirname" &>/dev/null
17     fi
18   done
19 }
20
21 find $dir -mindepth 1 -maxdepth 1 -type d | flattenizer
22