<commit_before>#!/bin/bash
set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

repos=( "$@" )
if [ ${#repos[@]} -eq 0 ]; then
	repos=( */ )
fi
repos=( "${repos[@]%/}" )

replace_field() {
	repo="$1"
	field="$2"
	content="$3"
	extraSed="${4:-}"
	sed_escaped_value="$(echo "$content" | sed 's/[\/&]/\\&/g')"
	sed_escaped_value="${sed_escaped_value//$'\n'/\\n}"
	sed -ri "s/${extraSed}%%${field}%%${extraSed}/$sed_escaped_value/g" "$repo/README.md"
}

declare -A otherRepos=(
	[busybox]='https://github.com/jpetazzo/docker-busybox'
	[centos]='https://github.com/CentOS/sig-cloud-instance-images'
	[cirros]='https://github.com/ewindisch/docker-cirros'
	[clojure]='https://github.com/Quantisan/docker-clojure'
	[crate]='https://github.com/crate/docker-crate'
	[crux]='https://github.com/therealprologic/docker-crux'
	[debian]='https://github.com/tianon/docker-brew-debian'
	[docker-dev]='https://github.com/docker/docker'
	[fedora]='https://github.com/lsm5/docker-brew-fedora'
	[haskell]='https://github.com/darinmorrison/docker-haskell'
	[hipache]='https://github.com/dotcloud/hipache'
	[hylang]='https://github.com/hylang/hy'
	[jenkins]='https://github.com/cloudbees/jenkins-ci.org-docker'
	[jruby]='https://github.com/cpuguy83/docker-jruby'
	[mageia]='https://github.com/juanluisbaptiste/docker-brew-mageia'
	[maven]='https://github.com/carlossg/docker-maven'
	[mono]='https://github.com/mono/docker'
	[neurodebian]='https://github.com/neurodebian/dockerfiles'
	[nginx]='https://github.com/nginxinc/docker-nginx'
	[opensuse]='https://github.com/openSUSE/docker-containers-build'
        [oraclelinux]='https://github.com/oracle/docker-images'
	[perl]='https://github.com/Perl/docker-perl'
	[registry]='https://github.com/docker/docker-registry'
	[r-base]='https://github.com/rocker-org/rocker'
	[ubuntu-debootstrap]='https://github.com/tianon/docker-brew-ubuntu-debootstrap'<commit_msg>Fix minor whitespace issue in update.sh<commit_after>#!/bin/bash
set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

repos=( "$@" )
if [ ${#repos[@]} -eq 0 ]; then
	repos=( */ )
fi
repos=( "${repos[@]%/}" )

replace_field() {
	repo="$1"
	field="$2"
	content="$3"
	extraSed="${4:-}"
	sed_escaped_value="$(echo "$content" | sed 's/[\/&]/\\&/g')"
	sed_escaped_value="${sed_escaped_value//$'\n'/\\n}"
	sed -ri "s/${extraSed}%%${field}%%${extraSed}/$sed_escaped_value/g" "$repo/README.md"
}

declare -A otherRepos=(
	[busybox]='https://github.com/jpetazzo/docker-busybox'
	[centos]='https://github.com/CentOS/sig-cloud-instance-images'
	[cirros]='https://github.com/ewindisch/docker-cirros'
	[clojure]='https://github.com/Quantisan/docker-clojure'
	[crate]='https://github.com/crate/docker-crate'
	[crux]='https://github.com/therealprologic/docker-crux'
	[debian]='https://github.com/tianon/docker-brew-debian'
	[docker-dev]='https://github.com/docker/docker'
	[fedora]='https://github.com/lsm5/docker-brew-fedora'
	[haskell]='https://github.com/darinmorrison/docker-haskell'
	[hipache]='https://github.com/dotcloud/hipache'
	[hylang]='https://github.com/hylang/hy'
	[jenkins]='https://github.com/cloudbees/jenkins-ci.org-docker'
	[jruby]='https://github.com/cpuguy83/docker-jruby'
	[mageia]='https://github.com/juanluisbaptiste/docker-brew-mageia'
	[maven]='https://github.com/carlossg/docker-maven'
	[mono]='https://github.com/mono/docker'
	[neurodebian]='https://github.com/neurodebian/dockerfiles'
	[nginx]='https://github.com/nginxinc/docker-nginx'
	[opensuse]='https://github.com/openSUSE/docker-containers-build'
	[oraclelinux]='https://github.com/oracle/docker-images'
	[perl]='https://github.com/Perl/docker-perl'
	[registry]='https://github.com/docker/docker-registry'
	[r-base]='https://github.com/rocker-org/rocker'
	[ubuntu-debootstrap]='https://github.com/tianon/docker-brew-ubuntu-debootstrap'
{'fraction_non_alphanumeric': 0.2404529892020016, 'fraction_numerical': 0.004213853041875165, 'mean_word_length': 5.351170568561873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 50, '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': '1935620', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1532, 'n_words': 124}