2024-03-28 19:03:32 +03:00
|
|
|
#!/bin/bash
|
2022-09-25 02:00:27 +03:00
|
|
|
|
|
|
|
echo -e "Making \033[0;31mYTCget\033[0m dist..."
|
|
|
|
|
2024-03-28 19:03:32 +03:00
|
|
|
if [ ! -d "./dist" ]; then
|
|
|
|
echo -e "Make \033[0;31m./dist/\033[0m directory."
|
|
|
|
mkdir "./dist/"
|
|
|
|
fi
|
2022-09-25 02:00:27 +03:00
|
|
|
|
2024-03-28 19:03:32 +03:00
|
|
|
echo -en "Cleaning \033[0;31m./dist/\033[0m directory..."
|
|
|
|
rm -rf "./dist/*"
|
|
|
|
echo " Complete!"
|
2022-09-25 02:00:27 +03:00
|
|
|
|
2024-03-28 19:03:32 +03:00
|
|
|
echo -n "Copying static files..."
|
|
|
|
cp ./src/youtubeID.js ./dist/youtubeID.js
|
|
|
|
cp ./src/ytcg.js ./dist/ytcg.js
|
|
|
|
echo " Complete!"
|
2022-09-25 02:00:27 +03:00
|
|
|
|
2024-03-28 19:03:32 +03:00
|
|
|
echo -n "Minifying files..."
|
|
|
|
minify-html ./src/styles.css -o ./dist/styles.css
|
|
|
|
minify-html \
|
|
|
|
--do-not-minify-doctype \
|
|
|
|
--keep-closing-tags \
|
|
|
|
--keep-spaces-between-attributes \
|
|
|
|
--keep-html-and-head-opening-tags \
|
|
|
|
./src/index.html -o ./dist/index.html
|
2022-09-25 02:00:27 +03:00
|
|
|
|
2024-03-28 19:03:32 +03:00
|
|
|
GIT_COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
|
|
sed -i -- "s/{GIT_COMMIT_HASH}/$GIT_COMMIT_HASH/g" ./dist/index.html
|
|
|
|
echo " Complete!"
|
|
|
|
|
|
|
|
echo -en "Making \033[0;31mytcg-$GIT_COMMIT_HASH.tar.xz\033[0m file..."
|
|
|
|
tar -cJf "ytcg-$GIT_COMMIT_HASH.tar.xz" ./dist/*
|
|
|
|
echo " Complete!"
|