<commit_before>#!/bin/bash

function die_with() { echo "$*" >&2; exit 1; }

echo "Checking if commit is a pull request"
if [ $TRAVIS_PULL_REQUEST == true ]; then die_with "Skipping deployment for pull request!"; fi

echo "Configuring git credentials"
git config --global user.email "<EMAIL>" && git config --global user.name "Travis" || die_with "Failed to configure git credentials!"

echo "Changing directory to $HOME and configuring git"
cd $HOME || die_with "Failed to change to home directory!"

echo "Cloning snapshots branch using token"
git clone -q --branch=snapshots https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git snapshots >/dev/null || die_with "Failed to clone existing snapshots branch!"

echo "Copying target files to temp directory"
mkdir -p $HOME/temp/RustDedicated_Data/Managed || die_with "Failed to create RustDedicated_Data/Managed directories!"
cd $HOME/build/$TRAVIS_REPO_SLUG || die_with "Failed to change to build directory!"
cp -f RustExperimental.opj OxidePatcher/bin/Release/OxidePatcher.exe $HOME/temp || die_with "Failed to copy RustExperimental.opj and OxidePatcher.exe!"
cp -f Dependencies/ICSharpCode.TextEditor.dll Dependencies/LinqBridge.dll Dependencies/Mono.Cecil.dll Dependencies/Newtonsoft.Json.dll $HOME/temp || die_with "Failed to copy dependency DLLs!"

echo "Archiving and compressing target files"
cd $HOME/temp || die_with "Failed to change to temp directory!"
zip -vr9 $HOME/snapshots/Oxide2Patcher.zip . || die_with "Failed to archive snapshot files!"

echo "Adding, committing, and pushing to snapshots branch"
cd $HOME/snapshots || die_with "Failed to change to snapshots directory!"
git add -f . && git commit -m "Oxide 2 Patcher build $TRAVIS_BUILD_NUMBER" || die_with "Failed to add and commit files with git!"
git push -qf origin snapshots >/dev/null || die_with "Failed to push snapshot to GitHub!"

echo "Deployment cycle completed. Happy developing!"<commit_msg>Rename arcive file and remove unneeded mkdir<commit_after>#!/bin/bash

function die_with() { echo "$*" >&2; exit 1; }

echo "Checking if commit is a pull request"
if [ $TRAVIS_PULL_REQUEST == true ]; then die_with "Skipping deployment for pull request!"; fi

echo "Configuring git credentials"
git config --global user.email "<EMAIL>" && git config --global user.name "Travis" || die_with "Failed to configure git credentials!"

echo "Changing directory to $HOME and configuring git"
cd $HOME || die_with "Failed to change to home directory!"

echo "Cloning snapshots branch using token"
git clone -q --branch=snapshots https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git snapshots >/dev/null || die_with "Failed to clone existing snapshots branch!"

echo "Copying target files to temp directory"
cd $HOME/build/$TRAVIS_REPO_SLUG || die_with "Failed to change to build directory!"
cp -f RustExperimental.opj OxidePatcher/bin/Release/OxidePatcher.exe $HOME/temp || die_with "Failed to copy RustExperimental.opj and OxidePatcher.exe!"
cp -f Dependencies/ICSharpCode.TextEditor.dll Dependencies/LinqBridge.dll Dependencies/Mono.Cecil.dll Dependencies/Newtonsoft.Json.dll $HOME/temp || die_with "Failed to copy dependency DLLs!"

echo "Archiving and compressing target files"
cd $HOME/temp || die_with "Failed to change to temp directory!"
zip -vr9 $HOME/snapshots/OxidePatcher.zip . || die_with "Failed to archive snapshot files!"

echo "Adding, committing, and pushing to snapshots branch"
cd $HOME/snapshots || die_with "Failed to change to snapshots directory!"
git add -f . && git commit -m "Oxide 2 Patcher build $TRAVIS_BUILD_NUMBER" || die_with "Failed to add and commit files with git!"
git push -qf origin snapshots >/dev/null || die_with "Failed to push snapshot to GitHub!"

echo "Deployment cycle completed. Happy developing!"
{'fraction_non_alphanumeric': 0.10175345377258235, 'fraction_numerical': 0.002391073326248672, 'mean_word_length': 5.275, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2292451', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1125, 'n_words': 422}