aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bootstrap.sh
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-04-03 16:44:35 -0500
committerJesús <heckyel@hyperbola.info>2019-04-03 16:44:35 -0500
commit30babccf3367379e4e2d3baf93d6284bbd143680 (patch)
tree32458bed0ebd43e7262e4b1af384e82d8bb667db /scripts/bootstrap.sh
downloadlibretube-theme-30babccf3367379e4e2d3baf93d6284bbd143680.tar.lz
libretube-theme-30babccf3367379e4e2d3baf93d6284bbd143680.tar.xz
libretube-theme-30babccf3367379e4e2d3baf93d6284bbd143680.zip
first commit
Diffstat (limited to 'scripts/bootstrap.sh')
-rw-r--r--scripts/bootstrap.sh68
1 files changed, 68 insertions, 0 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
new file mode 100644
index 0000000..bf6f350
--- /dev/null
+++ b/scripts/bootstrap.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+# ==============================================================================
+# FUNCTIONS - START
+# ==============================================================================
+
+run_it()
+{
+
+ local _name="${1-bootstrap}"
+ local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
+ local _target="${_dir%/*}" # deleted slash
+ local _src="${_target%scripts}/src/scss/bootstrap/${_name}.scss" # input
+ local _dest="${_target%scripts}/dist/css/bootstrap/${_name}.css" # output
+ local _options="${3---sourcemap=none}"
+
+ # ----------------------------------------------------------------------------
+ local _dest_dir
+ _dest_dir="$(dirname "${_dest}")"
+
+ if [ ! -d "${_dest_dir}" ]; then
+
+ mkdir -p "${_dest_dir}"
+
+ fi
+
+ # ----------------------------------------------------------------------------
+ sass "${_src}" "${_dest}" "${_options}" -t expanded
+
+}
+
+run_compress()
+{
+
+ local _name="${1-bootstrap}"
+ local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
+ local _target="${_dir%/*}" # deleted slash
+ local _src="${_target%scripts}/src/scss/bootstrap/${_name}.scss" # input
+ local _dest="${_target%scripts}/dist/css/bootstrap/${_name}.min.css" # output
+ local _options="${3---sourcemap=none}"
+
+ # ----------------------------------------------------------------------------
+ local _dest_dir
+ _dest_dir="$(dirname "${_dest}")"
+
+ if [ ! -d "${_dest_dir}" ]; then
+
+ mkdir -p "${_dest_dir}"
+
+ fi
+
+ # ----------------------------------------------------------------------------
+ sass "${_src}" "${_dest}" "${_options}" -t compressed
+
+}
+# ==============================================================================
+# FUNCTIONS - END
+# ==============================================================================
+
+# ==============================================================================
+# EXECUTION - START
+# ==============================================================================
+
+run_it "$@" && run_compress "$@"
+
+# ==============================================================================
+# EXECUTION - END
+# ==============================================================================