#!/bin/sh

# Check environment to build
ENV=$1
CUSTOM_ENV=$2

# Checking valid environment
if [ "$ENV" != "prod" ] && [ "$ENV" != "dev" ] && [ "$ENV" != "demo" ] && [ "$ENV" != "open-demo" ]; then
    if [ "$CUSTOM_ENV" != "true" ]; then
        echo "Invalid environment $ENV";
        exit 0;
    fi
    echo "WARNING: you are using a custom env $CUSTOM_ENV"
fi

ssh quantex@"$ENV".quantex.com.ar "mkdir -p qfixpt"
scp build/out/distribution/qfixpt.gz quantex@"$ENV".quantex.com.ar:./qfixpt/
ssh quantex@"$ENV".quantex.com.ar "unzip_qfixpt.sh"
