Last active
November 14, 2015 21:54
-
-
Save spalger/6f23abe8c63aa0737a50 to your computer and use it in GitHub Desktop.
Patch Sonarr static files so that they load properly on iOS, which interestingly loads the templates file for both the runtime and the templates...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
cd ~/apps/NzbDrone/UI; | |
all="handlebars.combined.js" | |
runtime="handlebars.runtime.js" | |
tmpl="templates.js" | |
##### | |
## cleanup previous runs | |
##### | |
[ -f "$all" ] && rm "$all"; | |
[ -f "$runtime.backup" ] && mv -f "$runtime.backup" "$runtime"; | |
[ -f "$tmpl.backup" ] && mv -f "$tmpl.backup" "$tmpl"; | |
#### | |
## Go! | |
#### | |
echo " | |
(function (root) { | |
// eject, previous combined libraries already loaded | |
if (root.Handlebars) return; | |
$(cat "$runtime") | |
$(cat "$tmpl") | |
}.call(this, this)); | |
" > "$all"; | |
mv "$runtime" "$runtime.backup"; | |
mv "$tmpl" "$tmpl.backup"; | |
cp "$all" "$runtime"; | |
cp "$all" "$tmpl"; | |
cd - > /dev/null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment