Skip to content

Commit c445758

Browse files
author
Aleksey Shichko
committed
actualize compilation script for multiple locations
1 parent 5283299 commit c445758

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

ez-compile.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
#!/usr/bin/sh
1+
#!/usr/bin/env bash
22

3-
filename=${1}
4-
# don't generate source maps
5-
sass_args="--no-source-map"
3+
# defaults
4+
import_path=""
65

76
usage() {
87
echo "Start watching for changes and compile emmidiately"
98
echo "filename.scss to filename.css"
10-
echo "Usage: ${0} <filename.scss>"
9+
echo "Usage: ${0} <filename.scss> [import_path]"
10+
echo " import_path - load-path arg to sass binary"
1111
}
1212

13-
if [[ -z "$filename" ]]; then
13+
if [[ -z "$1" ]]; then
1414
usage
1515
exit 1
1616
fi
17+
filename=${1}
18+
19+
if [ -n "$2" ]; then
20+
import_path="${2}"
21+
fi
1722

1823
# remove the longest suffix starting with "."
1924
base=${filename%%\.*}
2025
echo "Compiling $filename to ${base}.css"
21-
sass ${sass_args} --watch ${filename}:${base}.css
26+
27+
sass \
28+
--no-source-map `# don't generate source maps` \
29+
--load-path="${import_path}" \
30+
--watch ${filename}:${base}.css

homepage.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "/home/kip/.cache/wal/colors.scss";
1+
@import "colors.scss";
22

33
$background-color: $color0; // main background color
44
$color: $color7; // main font color

0 commit comments

Comments
 (0)