<commit_before>#!/bin/bash

set -euo pipefail

pngquant="pngquant 256 -"

. vars.sh

echo "Quantize source PNGs"
for i in picons-source/build-source/logos/*${iconset}.png; do
  src=$i
  dst=$(basename $i)
  cat $i | $pngquant > $dst
  echo -n '.'
done

cp picons-source/build-source/logos/*${iconset}.png $target/

echo "Convert and quantize SVGs"
for i in picons-source/build-source/logos/*${iconset}.svg; do
  svg=$i
  png=$target/$(basename "$i" ".svg").png
  rsvg-convert --keep-aspect-ratio --width=1000 --format=png $svg | $pngquant > $png
  echo -n '.'
done

echo "Rename (remove iconset suffix)"
for i in $target/*.png; do
  old=$i
  new=$(echo $old | sed "s/\.${iconset}\.png/.png/")
  mv $old $new
  echo -n '.'
done

echo "Link channel names"
mkdir -p $target/snp
for i in $(cat picons-source/build-source/snp-index); do
  sid=$(echo $i | cut -f1 -d=)
  chn=$(echo $i | cut -f2 -d=)
  ln -s $target/$chn.png $target/snp/$sid.png
  echo -n '.'
done

echo "Link service names - not yet functional"
mkdir -p $target/srp
for i in $(cat picons-source/build-source/srp-index); do
  sid=$(echo $i | cut -f1 -d=)
  chn=$(echo $i | cut -f2 -d=)
  ln -s $target/$chn.png $target/srp/$sid.png
  echo -n '.'
done

echo "Build complete"<commit_msg>deactivate service names<commit_after>#!/bin/bash

set -euo pipefail

pngquant="pngquant 256 -"

. vars.sh

echo "Quantize source PNGs"
for i in picons-source/build-source/logos/*${iconset}.png; do
  src=$i
  dst=$(basename $i)
  cat $i | $pngquant > $dst
  echo -n '.'
done

cp picons-source/build-source/logos/*${iconset}.png $target/

echo "Convert and quantize SVGs"
for i in picons-source/build-source/logos/*${iconset}.svg; do
  svg=$i
  png=$target/$(basename "$i" ".svg").png
  rsvg-convert --keep-aspect-ratio --width=1000 --format=png $svg | $pngquant > $png
  echo -n '.'
done

echo "Rename (remove iconset suffix)"
for i in $target/*.png; do
  old=$i
  new=$(echo $old | sed "s/\.${iconset}\.png/.png/")
  mv $old $new
  echo -n '.'
done

echo "Link channel names"
mkdir -p $target/snp
for i in $(cat picons-source/build-source/snp-index); do
  sid=$(echo $i | cut -f1 -d=)
  chn=$(echo $i | cut -f2 -d=)
  ln -s $target/$chn.png $target/snp/$sid.png
  echo -n '.'
done

#echo "Link service names - not yet functional"
#mkdir -p $target/srp
#for i in $(cat picons-source/build-source/srp-index); do
#  sid=$(echo $i | cut -f1 -d=)
#  chn=$(echo $i | cut -f2 -d=)
#  ln -s $target/$chn.png $target/srp/$sid.png
#  echo -n '.'
#done

echo "Build complete"
{'fraction_non_alphanumeric': 0.18956590999601752, 'fraction_numerical': 0.008761449621664676, 'mean_word_length': 3.1936560934891487, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5156187', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1007, 'n_words': 281}