123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #!/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}/build/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}/build/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
- # ==============================================================================
|