#!/bin/bash # MyPlayer - Copyright 2014 - 2024 tilt@linuxfoo.de GPLv3 # Build Script; generates a minified collective CSS file dir=$(readlink -f "$(dirname "$0")") if ! cd "$dir" ; then echo "ERROR: Could not change working directory; aborted." >&2 ; exit 1 ; elif [[ -z $(type -p r.js) ]] ; then echo "ERROR: r.js optimizer not found; install it using 'npm install -g requirejs'." >&2 exit 1 elif ! r.js -o cssIn=myplayer.css out=myplayer.min.css optimizeCss=standard.keepComments.keepLines ; then echo "ERROR: r.js failed; aborted." >&2 exit 1 else sed -i -e 's|../mediaelement-plugins/dist/playlist/||' myplayer.min.css chmod 0644 myplayer.min.css echo "INFO: Minimized CSS to $dir/myplayer.min.css" >&2 for svg in \ ../mediaelement-plugins/dist/playlist/playlist-controls.svg \ ../mediaelement/build/mejs-controls.svg do svg_out="$dir/$(basename "$svg")" if ! cp "$svg" "$svg_out" ; then echo "ERROR: Copying controls SVG $svg failed; aborted." >&2 exit 1 else echo "INFO: Copied controls SVG to $svg_out" >&2 fi done fi