<commit_before>#!/usr/bin/env bash

while test $# -gt 0; do
    case "$1" in
        --dev)
            APP_ENV="development"
            shift
            ;;
    esac
done

APP_ENV="${APP_ENV:-production}"

if [ $APP_ENV = "production" ]; then

    # Install Docker Engine
    wget -qO- https://get.docker.com/ | sh

    # Install docker-compose
    COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1`
    sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
    sudo chmod +x /usr/local/bin/docker-compose
    sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"

    docker-compose pull
    docker-compose run --rm cli azuracast_install
    docker-compose up -d

else

    read -p "This operation is destructive and will wipe your existing Docker containers. Continue? [y/N] " -n 1 -r
    echo

    if [[ $REPLY =~ ^[Yy]$ ]]; then

        docker-compose -f docker-compose.yml -f docker-compose.build.yml -f docker-compose.dev.yml down -v
        docker stop $(docker ps -a -q)
        docker rm $(docker ps -a -q)
        docker volume prune -f

        docker-compose -f docker-compose.yml -f docker-compose.dev.yml build<commit_msg>Fix omission in dev script on docker-install.<commit_after>#!/usr/bin/env bash

while test $# -gt 0; do
    case "$1" in
        --dev)
            APP_ENV="development"
            shift
            ;;
    esac
done

APP_ENV="${APP_ENV:-production}"

if [ $APP_ENV = "production" ]; then

    # Install Docker Engine
    wget -qO- https://get.docker.com/ | sh

    # Install docker-compose
    COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1`
    sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
    sudo chmod +x /usr/local/bin/docker-compose
    sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"

    docker-compose pull
    docker-compose run --rm cli azuracast_install
    docker-compose up -d

else

    read -p "This operation is destructive and will wipe your existing Docker containers. Continue? [y/N] " -n 1 -r
    echo

    if [[ $REPLY =~ ^[Yy]$ ]]; then

        docker-compose -f docker-compose.yml -f docker-compose.dev.yml down -v
        docker stop $(docker ps -a -q)
        docker rm $(docker ps -a -q)
        docker volume prune -f

        docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
{'fraction_non_alphanumeric': 0.1457182320441989, 'fraction_numerical': 0.008287292817679558, 'mean_word_length': 2.520048602673147, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5170438', 'n_tokens_mistral': 1121, 'n_tokens_neox': 990, 'n_words': 253}