musique/scripts/release
2022-09-18 21:25:42 +02:00

38 lines
910 B
Bash
Executable File

#!/usr/bin/env bash
set -e -o pipefail
Suffix="$(date +"%Y-%m-%d")"
Target="release_$Suffix"
if [ -d "$Target" ]; then
rm -rf "$Target"
fi
mkdir -p "$Target"
if ! [ -f bin/musique ]; then
make bin/musique
fi
echo "Copy bin/musique, examples, license and documentation"
cp bin/musique "$Target"/
cp LICENSE "$Target"/LICENSE
cp -r examples "$Target"/examples
sed "s/bin\/musique/musique/g" scripts/install > "$Target"/install.sh
chmod 0755 "$Target"/install.sh
lowdown -s doc/overview.md -m "title:Omówienie języka Musique" -o "$Target"/overview.html
lowdown -s doc/functions.md -m "title:Lista funkcji języka Musique" -o "$Target"/functions.html
echo "Copy source code"
git clone --recursive --quiet --depth=1 "$(git remote -v | awk '{ print $2 }' | head -n1)" "$Target"/source_code
rm -rf "$Target"/source_code/.git
echo "Boundle it all up"
zip -q -r "musique_$Suffix.zip" "$Target"/*