aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/post.bash
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-11-09 18:20:40 -0500
committerJesús <heckyel@hyperbola.info>2021-11-09 18:20:40 -0500
commit1e520729865883326ea52d8878c620979af74673 (patch)
tree071be2db0948d8c561ef516d7ed838fe3b52b5f0 /scripts/post.bash
downloadsimple-1e520729865883326ea52d8878c620979af74673.tar.lz
simple-1e520729865883326ea52d8878c620979af74673.tar.xz
simple-1e520729865883326ea52d8878c620979af74673.zip
initial import
Diffstat (limited to 'scripts/post.bash')
-rw-r--r--scripts/post.bash37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/post.bash b/scripts/post.bash
new file mode 100644
index 0000000..3cb46e9
--- /dev/null
+++ b/scripts/post.bash
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+_dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
+_target="${_dir%/*}" # deleted slash
+_dest="${_target%scripts}/dist/css/"
+
+# ==============================================================================
+# FUNCTIONS - START
+# ==============================================================================
+run_prepare() {
+ install -d -m755 "${_dest}"
+}
+
+run_it()
+{
+ local _name="${1-post}"
+ local _src="${_target%scripts}/src/scss/styles/${_name}.scss" # input
+ local _fdest="${_target%scripts}/dist/css/${_name}.css" # output
+ # ----------------------------------------------------------------------------
+ sassc -t expanded "${_src}" "${_fdest}"
+}
+
+run_compress()
+{
+ local _name="${1-post}"
+ local _src="${_target%scripts}/src/scss/styles/${_name}.scss" # input
+ local _fdest="${_target%scripts}/dist/css/${_name}.min.css" # output
+ # ----------------------------------------------------------------------------
+ sassc -t compressed "${_src}" "${_fdest}"
+}
+
+# ==============================================================================
+# EXECUTION - START
+# =============================================================================
+run_prepare "$@"
+run_it "$@"
+run_compress "$@"