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

# ./scripts/archive-all.sh
tmpdir=/tmp/.xmake_archive
xmakeroot=`pwd`
if [ -d $tmpdir ]; then
    rm -rf $tmpdir
fi
mkdir $tmpdir

# copy xmake repo to temproot/xmake-repo, remove git ignored files
cp -r $xmakeroot $tmpdir/repo
cd $tmpdir/repo
git reset --hard HEAD
git clean -fd
git submodule foreach git clean -fd

# prepare files
version=`cat core/xmake.lua | grep -E "^set_version" | grep -oE "[0-9]*\.[0-9]*\.[0-9]*"`
outputfile=$xmakeroot/xmake-v$version
xmake l -v private.utils.bcsave -s -o $tmpdir/repo/output $tmpdir/repo/xmake
rm -rf xmake
mv output xmake
rm -rf tests
rm -rf core/src/tbox/tbox/src/demo
cd core/src/tbox/tbox
git add .
git commit -a -m "..."
cd -
git add .
git commit -a -m "..."
git tag "v$version-1"
ls -l
git archive --format "zip" -9 -o "$outputfile.zip" "v$version-1"
git archive --format "tar.gz" -9 -o "$outputfile.tar.gz" "v$version-1"
shasum -a 256 "$outputfile.zip"
shasum -a 256 "$outputfile.tar.gz"<commit_msg>update script<commit_after>#!/usr/bin/env bash

# ./scripts/archive-all.sh
tmpdir=/tmp/.xmake_archive
xmakeroot=`pwd`
if [ -d $tmpdir ]; then
    rm -rf $tmpdir
fi
mkdir $tmpdir

# clone xmake repo 
cp -r $xmakeroot $tmpdir/repo
cd $tmpdir/repo
git reset --hard HEAD
git clean -dfX
git submodule foreach git clean -dfX

# prepare files
xmake l -v private.utils.bcsave -s -o $tmpdir/repo/output $tmpdir/repo/xmake
cd $tmpdir/repo || exit
version=`cat core/xmake.lua | grep -E "^set_version" | grep -oE "[0-9]*\.[0-9]*\.[0-9]*"`
outputfile=$xmakeroot/xmake-v$version
rm -rf xmake
mv output xmake
rm -rf tests
rm -rf core/src/tbox/tbox/src/demo
cd core/src/tbox/tbox 
cd $tmpdir/repo || exit
rm -rf `find ./ -name ".git"`
ls -a -l
if [ -f "$outputfile.zip" ]; then
    rm "$outputfile.zip"
fi
if [ -f "$outputfile.7z" ]; then
    rm "$outputfile.7z"
fi
zip -qr "$outputfile.zip" .
7z a "$outputfile.7z" .
shasum -a 256 "$outputfile.zip"
shasum -a 256 "$outputfile.7z"
ls -l "$outputfile.zip"
ls -l "$outputfile.7z"
{'fraction_non_alphanumeric': 0.16825237856785177, 'fraction_numerical': 0.017526289434151226, 'mean_word_length': 3.3624454148471616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '200244', 'n_tokens_mistral': 843, 'n_tokens_neox': 809, 'n_words': 236}