refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / sass / install.sh
1 #!/bin/bash
2
3 function __init_sass() {
4     set -e
5     set -u
6
7     ##################
8     # Install sass #
9     ##################
10
11     pkg_cmd_name="sass"
12
13     pkg_dst_cmd="$HOME/.local/bin/sass"
14     pkg_dst="$pkg_dst_cmd"
15
16     # no ./bin dir here because of how the macOS version is packaged
17     pkg_src_cmd="$HOME/.local/opt/dart-sass-v$WEBI_VERSION/sass"
18     pkg_src_dir="$HOME/.local/opt/dart-sass-v$WEBI_VERSION"
19     pkg_src="$pkg_src_cmd"
20
21     # pkg_install must be defined by every package
22     pkg_install() {
23         # moves everything, for macOS' sake
24         mkdir -p "$pkg_src_dir"
25         mv ./dart-sass/* "$pkg_src_dir"
26     }
27
28     pkg_get_current_version() {
29         echo $(sass --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)
30     }
31
32 }
33
34 __init_sass