-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail early when there is an error in the downloading of a Bootswatch …
…theme Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> (cherry picked from commit 6c54b09) Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
- Loading branch information
Showing
1 changed file
with
17 additions
and
8 deletions.
There are no files selected for viewing
25 changes: 17 additions & 8 deletions
25
...trap-themes/src/main/java/de/agilecoders/wicket/themes/markup/html/bootswatch/gettheme.sh
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
#!/bin/bash | ||
|
||
get() { | ||
curl --silent --fail $@ | ||
exit_code=$? | ||
if [[ $exit_code > 0 ]]; then | ||
echo "A problem occurred while downloading the theme!" | ||
exit $exit_code | ||
fi | ||
} | ||
|
||
downloadTheme() { | ||
theme=$1 | ||
version=$2 | ||
mkdir -p css | ||
|
||
echo "Downloading '$theme@$version" | ||
wget "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/_variables.scss" -O css/bootstrap.$theme.variables.scss | ||
wget "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/_bootswatch.scss" -O css/bootstrap.$theme.scss | ||
wget "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.min.css" -O css/bootstrap.$theme.min.css | ||
wget "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.css" -O css/bootstrap.$theme.css | ||
wget "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.rtl.min.css" -O css/bootstrap.rtl.$theme.min.css | ||
wget "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.rtl.css" -O css/bootstrap.rtl.$theme.css | ||
echo "Downloading $theme@$version" | ||
get "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/_variables.scss" -o css/bootstrap.$theme.variables.scss | ||
get "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/_bootswatch.scss" -o css/bootstrap.$theme.scss | ||
get "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.min.css" -o css/bootstrap.$theme.min.css | ||
get "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.css" -o css/bootstrap.$theme.css | ||
get "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.rtl.min.css" -o css/bootstrap.rtl.$theme.min.css | ||
get "https://cdn.jsdelivr.net/npm/bootswatch@$version/dist/$theme/bootstrap.rtl.css" -o css/bootstrap.rtl.$theme.css | ||
|
||
echo -e "@import \"../../bootstrap/css/bootstrap.scss\";\n@import \"bootstrap.$theme.variables.scss\";\n\n" | cat - css/bootstrap.$theme.scss > tmp.$theme.out && mv tmp.$theme.out css/bootstrap.$theme.scss | ||
} | ||
|
||
for theme in cerulean cosmo cyborg darkly flatly journal litera lumen lux materia minty morph pulse quartz sandstone simplex sketchy slate solar spacelab superhero united vapor yeti zephyr | ||
do | ||
downloadTheme $theme 'v5.3.3' 2>&1 & >/dev/null | ||
downloadTheme $theme 'v5.3.3' | ||
done | ||
|