Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
meltmedia/meltconsole / melt-pull-files.sh
Size: Mime:
#!/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!"