<commit_before>#! /bin/sh

client=$1
netinst="../raspbian-ua-netinst"
branch=$(cat ../netinst.branch)

if [ "$client" = "" ]; then
  echo "Usage: make.sh <hostname>"
  exit 1
fi

echo "Update the mod-ua files..."
git pull
git fetch origin
git checkout $branch
git reset --hard origin/$branch && \
git clean -f -d

echo "Update the raspbian-ua-netinst files..."
pushd ../raspbian-ua-netinst
git pull
git fetch origin
git checkout $branch
git reset --hard origin/$branch && \
git clean -f -d
popd

echo "Put modifications in place"
cp installer-config.txt $netinst/
cp post-install.txt $netinst/
cp -r config $netinst/

echo "Building image"
pushd ../raspbian-ua-netinst

./clean.sh
./update.sh
./build.sh

sed -i "s/raspberrypi/${client}/" ./bootfs/installer-config.txt

#./buildroot

popd<commit_msg>test exit code of pushd<commit_after>#! /bin/sh

client=$1
netinst="../raspbian-ua-netinst"
branch=$(cat ../netinst.branch)

if [ "$client" = "" ]; then
  echo "Usage: mod-ua.sh <hostname>"
  exit 1
fi

echo "Update the mod-ua files..."
git pull
git fetch origin
git checkout $branch
git reset --hard origin/$branch && \
git clean -f -d

echo "Update the raspbian-ua-netinst files..."
pushd ../raspbian-ua-netinst/
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi

git pull
git fetch origin
git checkout $branch
git reset --hard origin/$branch && \
git clean -f -d
popd

echo "Put modifications in place"
cp installer-config.txt $netinst/
cp post-install.txt $netinst/
cp -r config $netinst/

echo "Building image"
pushd ../raspbian-ua-netinst/
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi

./clean.sh
./update.sh
./build.sh

sed -i "s/raspberrypi/${client}/" ./bootfs/installer-config.txt

#./buildroot

popd
{'fraction_non_alphanumeric': 0.1638285378743394, 'fraction_numerical': 0.0035231943628890195, 'mean_word_length': 3.3139240506329113, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '552687', 'n_tokens_mistral': 629, 'n_tokens_neox': 614, 'n_words': 199}