Repository URL to install this package:
|
Version:
2.2.8 ▾
|
meltmedia/meltconsole
/
melt-pull-files.sh
|
|---|
#!/bin/bash
# Parse arguments with `=`
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
for i in "$@"
do
case $i in
--env=*)
ENVIRONMENT="${i#*=}"
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
# Exit if no environment was detected
if [ -z "${ENVIRONMENT}" ]; then
echo "Value for --env missing."
exit 1
fi
echo "Pull files from ${ENVIRONMENT^^}..."
drush rsync @melt.dev:docroot/sites/default/files/ @self:sites/default/files/
echo "Complete!"