<commit_before>#!/bin/bash
# A specialized script which copies the contents of deployment tar files to a given location, suitable
# to be served as 
tar_file=${1:?Must be .tar file produced by any of the *-deploy.sh scripts}
program_type=${2:?Is the type of the program contained in the tar file, e.g. cli}
version=${3:?The program version contained in the tar file, e.g. 0.2.0 (no leading v)}
os_name=${4:?The OS name on which the contents of the tar files was produced, e.g. osx, ubuntu}
base_dir=${5:?Is the root path of the download directory, e.g. /var/www/downloads}


dest_dir=${base_dir}/google.rs/${program_type}/${version}/${os_name}
mkdir -p ${dest_dir} || exit $?
cd ${dest_dir} && tar -xzvf ${tar_file} || exit $?
for file in *; do 
	program_tar_file=${file}.tar.gz
	tar -czf ${program_tar_file} $file && rm $file && echo "Created ${program_tar_file}"
done

echo Extracted programs from $tar_file to ${dest_dir}
<commit_msg>fix(deployment): limit tar.gz to executable<commit_after>#!/bin/bash
# A specialized script which copies the contents of deployment tar files to a given location, suitable
# to be served as 
tar_file=${1:?Must be .tar file produced by any of the *-deploy.sh scripts}
program_type=${2:?Is the type of the program contained in the tar file, e.g. cli}
version=${3:?The program version contained in the tar file, e.g. 0.2.0 (no leading v)}
os_name=${4:?The OS name on which the contents of the tar files was produced, e.g. osx, ubuntu}
base_dir=${5:?Is the root path of the download directory, e.g. /var/www/downloads}


dest_dir=${base_dir}/google.rs/${program_type}/${version}/${os_name}
mkdir -p ${dest_dir} || exit $?
cd ${dest_dir} && tar -xzvf ${tar_file} || exit $?
for file in `find . -executable -type f`; do 
	program_tar_file=${file}.tar.gz
	tar -czf ${program_tar_file} $file && rm $file && echo "Created ${program_tar_file}"
done

echo Extracted programs from $tar_file to ${dest_dir}

{'fraction_non_alphanumeric': 0.13878819264629724, 'fraction_numerical': 0.008285862247540134, 'mean_word_length': 4.732937685459941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7381206', 'n_tokens_mistral': 663, 'n_tokens_neox': 641, 'n_words': 242}