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

set -e
set -x

clone_repo() {
    git clone <EMAIL>:raiden-network/homebrew-raiden
    cd homebrew-raiden
}

setup_git() {
    openssl aes-256-cbc -K $encrypted_d89a2734327d_key -iv $encrypted_d89a2734327d_iv -in ../.travis/homebrew-raiden_github_deploy.enc -out ${HOME}/homebrew-raiden_github_deploy -d
    # Configure SSH key and disable host key checking to avoid hanging at the prompt
    git config core.sshCommand "ssh -i ~/homebrew-raiden_github_deploy -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
    git config user.email "<EMAIL>"
    git config user.name "Raiden Network"
}

update_formula() {
    UPDATED_SHA256=$(openssl sha -sha256 dist/archive/raiden-${TRAVIS_TAG}-macOS.zip)
    FORMULA_FILE="homebrew-raiden/raiden.rb"

    sed -i .bak "s/[0-9]\.[0-9]\.[0-9]/${TRAVIS_TAG/v/}/g" $FORMULA_FILE
    sed -i .bak "s/sha256 \"[a-f0-9]\{64\}\"/sha256 \"${UPDATED_SHA256: -64}\"/g" $FORMULA_FILE

    rm $FORMULA_FILE.bak
}

commit_formula_file() {
    git add raiden.rb
    git commit -m "Update formula to ${TRAVIS_TAG}"
    git tag -a "${TRAVIS_TAG}"
}

upload_file() {
    git push --follow-tags
}

clone_repo
setup_git
update_formula
commit_formula_file
upload_file<commit_msg>Fix homebrew formula updating. Again.<commit_after>#!/usr/bin/env bash

set -e
set -x

clone_repo() {
    git clone <EMAIL>:raiden-network/homebrew-raiden
    cd homebrew-raiden
}

setup_git() {
    openssl aes-256-cbc -K $encrypted_d89a2734327d_key -iv $encrypted_d89a2734327d_iv -in ../.travis/homebrew-raiden_github_deploy.enc -out ${HOME}/homebrew-raiden_github_deploy -d
    # Configure SSH key and disable host key checking to avoid hanging at the prompt
    git config --global core.sshCommand "ssh -i ~/homebrew-raiden_github_deploy -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
    git config --global user.email "<EMAIL>"
    git config --global user.name "Raiden Network"
}

update_formula() {
    UPDATED_SHA256=$(openssl sha -sha256 dist/archive/raiden-${TRAVIS_TAG}-macOS.zip)
    FORMULA_FILE="homebrew-raiden/raiden.rb"

    sed -i .bak "s/[0-9]\.[0-9]\.[0-9]/${TRAVIS_TAG/v/}/g" $FORMULA_FILE
    sed -i .bak "s/sha256 \"[a-f0-9]\{64\}\"/sha256 \"${UPDATED_SHA256: -64}\"/g" $FORMULA_FILE

    rm $FORMULA_FILE.bak
}

commit_formula_file() {
    git add raiden.rb
    git commit -m "Update formula to ${TRAVIS_TAG}"
    git tag -a "${TRAVIS_TAG}"
}

upload_file() {
    git push --follow-tags
}

setup_git
clone_repo
update_formula
commit_formula_file
upload_file
{'fraction_non_alphanumeric': 0.13863725876329264, 'fraction_numerical': 0.03781016148089799, 'mean_word_length': 3.6691176470588234, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1649051', 'n_tokens_mistral': 1075, 'n_tokens_neox': 980, 'n_words': 210}