corrade-nucleus-nucleons – Rev 1

Subversion Repositories:
Rev:
#!/bin/sh
###########################################################################
##  Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3      ##
##  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  ##
##  rights of fair usage, the disclaimer and warranty conditions.        ##
###########################################################################
# Creates a nucleon by scanning current directory for source payloads.    #
###########################################################################

###########################################################################
#                            CONFIGURATION                                #
###########################################################################

# The compression ratio.
COMPRESSION_RATIO="9"

###########################################################################
#                               INTERNALS                                 #
###########################################################################

NUCLEONS=(*"_"*)
for NUCLEON in "${NUCLEONS[@]}"; do
    if [ ! -d "$NUCLEON" ]; then
        continue
    fi
    if [ -f $NUCLEON".zip" ]; then
        rm $NUCLEON".zip"
    fi
    `unset CDPATH && \
        cd $NUCLEON && \
        zip -$COMPRESSION_RATIO -q -r "../$NUCLEON.zip" ./`
done