From 4d991ead3e770ea1ccaf56beea1dfc5fe351ea9d Mon Sep 17 00:00:00 2001 From: traxys Date: Sun, 28 May 2023 19:47:05 +0200 Subject: [PATCH] app: Add bootstrap icons --- app/Trunk.toml | 4 ++++ app/dl_bootstrap.sh | 18 +++++++++--------- app/dl_bootstrap_icons.sh | 17 +++++++++++++++++ app/index.html | 6 +++++- 4 files changed, 35 insertions(+), 10 deletions(-) create mode 100755 app/dl_bootstrap_icons.sh diff --git a/app/Trunk.toml b/app/Trunk.toml index f966ead..3c86e35 100644 --- a/app/Trunk.toml +++ b/app/Trunk.toml @@ -1,3 +1,7 @@ [[hooks]] stage = "build" command = "./dl_bootstrap.sh" + +[[hooks]] +stage = "build" +command = "./dl_bootstrap_icons.sh" diff --git a/app/dl_bootstrap.sh b/app/dl_bootstrap.sh index f242723..dbf37c7 100755 --- a/app/dl_bootstrap.sh +++ b/app/dl_bootstrap.sh @@ -4,14 +4,14 @@ VERSION=5.3.0-alpha3 URL=https://github.com/twbs/bootstrap/releases/download/v${VERSION}/bootstrap-${VERSION}-dist.zip if [[ ! -d "$TRUNK_DIST_DIR/bootstrap" ]]; then - cd "$TRUNK_STAGING_DIR" || { - echo "Can't cd to staging directory" - exit 1 - } - wget "$URL" - unzip bootstrap-*.zip - rm bootstrap-*.zip - mv bootstrap-* bootstrap + cd "$TRUNK_STAGING_DIR" || { + echo "Can't cd to staging directory" + exit 1 + } + wget "$URL" + unzip bootstrap-$VERSION-dist.zip + rm bootstrap-$VERSION-dist.zip + mv bootstrap-$VERSION-dist bootstrap else - cp -r "$TRUNK_DIST_DIR/bootstrap" "$TRUNK_STAGING_DIR" + cp -r "$TRUNK_DIST_DIR/bootstrap" "$TRUNK_STAGING_DIR" fi diff --git a/app/dl_bootstrap_icons.sh b/app/dl_bootstrap_icons.sh new file mode 100755 index 0000000..8a075e3 --- /dev/null +++ b/app/dl_bootstrap_icons.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +VERSION=1.10.5 +URL=https://github.com/twbs/icons/releases/download/v${VERSION}/bootstrap-icons-${VERSION}.zip + +if [[ ! -d "$TRUNK_DIST_DIR/bootstrap-icons" ]]; then + cd "$TRUNK_STAGING_DIR" || { + echo "Can't cd to staging directory" + exit 1 + } + wget "$URL" + unzip bootstrap-icons-$VERSION.zip + rm bootstrap-icons-$VERSION.zip + mv bootstrap-icons-$VERSION bootstrap-icons +else + cp -r "$TRUNK_DIST_DIR/bootstrap-icons" "$TRUNK_STAGING_DIR" +fi diff --git a/app/index.html b/app/index.html index b8aa8c3..947a6c9 100644 --- a/app/index.html +++ b/app/index.html @@ -4,7 +4,11 @@ - + +