Mario is not good with Bash.

This commit is contained in:
Mario Zechner 2023-05-27 21:57:06 +02:00
parent 1a75092da4
commit b3d3a30286
2 changed files with 5 additions and 10 deletions

View File

@ -1,14 +1,11 @@
#!/bin/bash
directory="site"
if [ ! -d "$directory" ]; then
echo "Directory does not exist."
exit 1
fi
cd "$directory" || exit 1
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pushd $dir > /dev/null
pushd site
find . -type f -name "*.html" -print0 | while IFS= read -r -d $'\0' file; do
sed -i 's/href="index\.html"/href="index-old.html"/g' "$file"
done
echo "Replacement complete."
popd
mv site/index.html site/index-old.html
mv site/index-new.html site/index.html

View File

@ -29,10 +29,8 @@ pushd $dir > /dev/null
case "$1" in
start)
pushd $dir/..
git pull
./deploy.sh
popd
../deploy.sh
docker-compose -p heisse-preise -f docker-compose.base.yml -f docker-compose.prod.yml build
docker-compose -p heisse-preise -f docker-compose.base.yml -f docker-compose.prod.yml up -d
;;