<commit_before>#!/bin/sh

# Use sudo less Ruby
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH


if [ ! $# -eq 1 ]; then
    echo "Usage: ./buildRelease.sh [tag or branch]"
    exit 1
fi 

if [ ! -n "$APPLE_ID" ]; then
    echo "You must set the APPLE_ID env var before calling this script"
    echo 'export APPLE_ID="<EMAIL>"'
    exit 1
fi 


TAG=$1
BUILD_DIR="build"/$TAG
BUILD_NUMBER=$( date +%Y%m%d%H%M%S )


if [ -e $BUILD_DIR ]; then
    echo "Error: Folder ${BUILD_DIR} already exists"
    exit 1
fi 


# Fastlane update
gem install bundler
bundle install
bundle update


# Checkout the source to build
mkdir -p $BUILD_DIR
cd $BUILD_DIR
REPO_URL=$(git ls-remote --get-url origin)
git clone $REPO_URL
REPO_NAME=$(basename -s .git $REPO_URL)
cd $REPO_NAME
git checkout $TAG $TAG

# Use appropriated dependencies according to the current branch
bundle exec fastlane point_dependencies_to_same_feature

# Build
bundle exec fastlane app_store build_number:$BUILD_NUMBER

if [ -e out/Riot.ipa ]; then
    # Here is the artefact
    cp out/Riot.ipa ../../../Riot-$TAG-$BUILD_NUMBER.ipa
    
    echo "Riot-$TAG-$BUILD_NUMBER.ipa has been successfully built"
fi<commit_msg>BuildRelease.sh: Fix checkout of tag<commit_after>#!/bin/sh

# Use sudo less Ruby
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH


if [ ! $# -eq 1 ]; then
    echo "Usage: ./buildRelease.sh [tag or branch]"
    exit 1
fi 

if [ ! -n "$APPLE_ID" ]; then
    echo "You must set the APPLE_ID env var before calling this script"
    echo 'export APPLE_ID="<EMAIL>"'
    exit 1
fi 


TAG=$1
BUILD_DIR="build"/$TAG
BUILD_NUMBER=$( date +%Y%m%d%H%M%S )


if [ -e $BUILD_DIR ]; then
    echo "Error: Folder ${BUILD_DIR} already exists"
    exit 1
fi 


# Fastlane update
gem install bundler
bundle install
bundle update


# Checkout the source to build
mkdir -p $BUILD_DIR
cd $BUILD_DIR
REPO_URL=$(git ls-remote --get-url origin)
REPO_NAME=$(basename -s .git $REPO_URL)
git clone $REPO_URL --depth=1 --branch $TAG
cd $REPO_NAME


# Use appropriated dependencies according to the current branch
bundle exec fastlane point_dependencies_to_same_feature

# Build
bundle exec fastlane app_store build_number:$BUILD_NUMBER

if [ -e out/Riot.ipa ]; then
    # Here is the artefact
    cp out/Riot.ipa ../../../Riot-$TAG-$BUILD_NUMBER.ipa
    
    echo "Riot-$TAG-$BUILD_NUMBER.ipa has been successfully built"
fi
{'fraction_non_alphanumeric': 0.11617216882574175, 'fraction_numerical': 0.00459674049310489, 'mean_word_length': 3.63953488372093, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3282766', 'n_tokens_mistral': 873, 'n_tokens_neox': 829, 'n_words': 270}