refcodes-batch.0.3.0.source-code.clone-folder-template.job Maven / Gradle / Ivy
#!/bin/bash
. $SCRIPT_DIR/lib-filesystem.inc
if [[ $HELP = y ]] ; then
echo "The switch \"-j $JOB\" uses a given configuration to " >&2
echo "clone template folder to a (target) folder. " >&2
# echo "--------------------------------------------------------------------------------" >&2
logSeparator
fi
. $SCRIPT_DIR/validate-folder-config.job
. $SCRIPT_DIR/validate-folder-template-config.job
if [[ $HELP = y ]] ; then
exit $EXIT_SUCCESS
fi
exitOnConfigOff "FOLDER"
exitOnConfigOff "FOLDER_TEMPLATE"
if [[ $VERBOSE = y ]] ; then
echo "Cloning folder \"$FOLDER_TEMPLATE_DIR\" to \"$FOLDER_DIR\" ..." >&2
logSeparator
fi
cp -aR $FOLDER_TEMPLATE_DIR $FOLDER_DIR
exitOnError "Unable to clone folder \"$FOLDER_TEMPLATE_DIR\" to \"$FOLDER_DIR\" !!!"
echo " Folder clone at \"$FOLDER_DIR\" from \"$FOLDER_TEMPLATE_DIR\" was created:" >&2
# echo "--------------------------------------------------------------------------------" >&2
logSeparator
echo "+ Folder clone details see: \"$FOLDER_DIR\"" >&2
# echo "--------------------------------------------------------------------------------" >&2
logSeparator
showSuccess "Cloned \"$FOLDER_TEMPLATE_DIR\" to \"$FOLDER_DIR\" !"