aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/style.sh
blob: 8c7aaf353b758faee4178bac627fba7ccc15d8e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash

# ==============================================================================
# FUNCTIONS - START
# ==============================================================================

run_it()
{

    local _name="${1-style}"
    local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
    local _src="${_dir%scripts}/src/sass/custom/${_name}.sass" # 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}"

}
# run_it()

# ==============================================================================
# FUNCTIONS - END
# ==============================================================================



# ==============================================================================
# EXECUTION - START
# ==============================================================================

run_it "$@"

# ==============================================================================
# EXECUTION - END
# ==============================================================================