diff options
author | Jesús <heckyel@hyperbola.info> | 2019-03-25 11:50:45 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-03-25 11:50:45 -0500 |
commit | e8e749091e10d44131fe68203fbcae1fb0a6c789 (patch) | |
tree | bced493a611e360d72680ca8eb2412e07eb9d728 | |
parent | 0cb80c73cf038ef08a9eb0af9eb3d18c0dfffad3 (diff) | |
download | cl-theme-e8e749091e10d44131fe68203fbcae1fb0a6c789.tar.lz cl-theme-e8e749091e10d44131fe68203fbcae1fb0a6c789.tar.xz cl-theme-e8e749091e10d44131fe68203fbcae1fb0a6c789.zip |
add script for playlist
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | scripts/aplaylist.sh | 72 | ||||
-rw-r--r-- | scripts/js.sh | 18 | ||||
-rw-r--r-- | scripts/playlist.sh | 72 |
4 files changed, 166 insertions, 4 deletions
@@ -1,4 +1,4 @@ -all: clean bulma fonts icons js styles +all: clean bulma fonts icons js styles playlist aplaylist clean: @rm -rf dist/ @@ -12,6 +12,12 @@ icons: styles: @bash scripts/styles.sh +playlist: + @bash scripts/playlist.sh + +aplaylist: + @bash scripts/aplaylist.sh + fonts: @bash scripts/fonts.sh js: diff --git a/scripts/aplaylist.sh b/scripts/aplaylist.sh new file mode 100644 index 0000000..e52bb8b --- /dev/null +++ b/scripts/aplaylist.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# ============================================================================== +# FUNCTIONS - START +# ============================================================================== + +run_it() +{ + + local _name="${1-aplaylist}" + local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" + local _src="${_dir%scripts}/src/scss/aplaylist/${_name}.scss" # input + local _dest="${_dir%scripts}/dist/css/${_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-aplaylist}" + local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" + local _src="${_dir%scripts}/src/scss/aplaylist/${_name}.scss" # input + local _dest="${_dir%scripts}/dist/css/${_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 + +} + +# run_it() + +# ============================================================================== +# FUNCTIONS - END +# ============================================================================== + + + +# ============================================================================== +# EXECUTION - START +# ============================================================================== + +run_it "$@" && run_compress "$@" + +# ============================================================================== +# EXECUTION - END +# ============================================================================== diff --git a/scripts/js.sh b/scripts/js.sh index 5b7424b..635c32b 100644 --- a/scripts/js.sh +++ b/scripts/js.sh @@ -8,11 +8,23 @@ run_navbar() local _src="${_dir%scripts}/src/js/${_name}.js" # input local _dest="${_dir%scripts}/dist/js/" # output - # copy font Roboto + if [[ -n "${_src}" ]]; + then + mkdir -p "${_dest}" + cp -fv "${_src}" "${_dest}" + fi + +} + +run_aplaylist() +{ + local _name="${1-aplaylist}" + local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" + local _src="${_dir%scripts}/src/js/${_name}.js" # input + local _dest="${_dir%scripts}/dist/js/" # output if [[ -n "${_src}" ]]; then - rm -rfv "${_dest}" mkdir -p "${_dest}" cp -fv "${_src}" "${_dest}" fi @@ -22,4 +34,4 @@ run_navbar() # ============================================================================== # EXECUTION - START # ============================================================================== -run_navbar "$@" +run_navbar "$@" && run_aplaylist "$@" diff --git a/scripts/playlist.sh b/scripts/playlist.sh new file mode 100644 index 0000000..5f3b98a --- /dev/null +++ b/scripts/playlist.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# ============================================================================== +# FUNCTIONS - START +# ============================================================================== + +run_it() +{ + + local _name="${1-playlist}" + local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" + local _src="${_dir%scripts}/src/scss/playlist/${_name}.scss" # input + local _dest="${_dir%scripts}/dist/css/${_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-playlist}" + local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" + local _src="${_dir%scripts}/src/scss/playlist/${_name}.scss" # input + local _dest="${_dir%scripts}/dist/css/${_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 + +} + +# run_it() + +# ============================================================================== +# FUNCTIONS - END +# ============================================================================== + + + +# ============================================================================== +# EXECUTION - START +# ============================================================================== + +run_it "$@" && run_compress "$@" + +# ============================================================================== +# EXECUTION - END +# ============================================================================== |