#! /bin/bash
# Execute from Hostinger machine
ZIP_FILE="enruta_web_dashboard.zip"
INSTALL_PATH="public_html/subdomains/console/"

if [[ -e "$ZIP_FILE" ]]; then
    cd ~/$INSTALL_PATH
    # Delete previous revision
    rm -rf assets/ dist/ images/ .htaccess favicon.ico index.html
    # Unzip new revision and install
    unzip $ZIP_FILE
    mv dist/* .
    mv dist/.htaccess .
    # Remove garbage
    rm -rf dist/
    rm $ZIP_FILE
    # Update revision date
    date > updated_at
else
    echo "Zip file not available or renamed!"
    exit -1
fi



