Skip to content
Extraits de code Groupes Projets

Resolve "The ci must archive files to make transfer to the game easy"

Fusionnées Thomas Saquet a demandé de fusionner 54-the-ci-must-archive-files-to-make-transfer-to-the-game-easy vers master
2 fichiers
+ 43
0
Comparer les modifications
  • Côte à côte
  • En ligne
Fichiers
2
+ 29
0
#!/bin/bash
CHARACTER_LIMIT=80000
file_number=1
total_chars=0
rm -f archive.tar.part*
for line in $(find `pwd` -name "*.*" | grep -v '/archives/' | grep -v *.md | grep -v *.sh); do
input_file_name=$(echo "$line" | sed -E 's/^.*\/scripts\///')
chars=$(wc -c $line | cut -d' ' -f 1)
archive_header='"#archive '$input_file_name'"'
archive_header_character_count=$(echo $archive_header | wc -c)
if (( $total_chars + $archive_header_character_count + $chars > $CHARACTER_LIMIT )); then
file_number=$(( $file_number + 1 ))
total_chars=0
else
total_chars=$(( $total_chars + $chars + $archive_header_character_count + 1 ))
fi
output_file_name=archive.tar.part$file_number
echo -e $archive_header >> $output_file_name
cat $line >> $output_file_name
echo -e "\n" >> $output_file_name
done
Chargement en cours