-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget.sh
40 lines (32 loc) · 997 Bytes
/
get.sh
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
#!/usr/bin/env bash
set -e
if [ $# -eq 0 ]; then
echo "Usage: $0 <sass_version>"
echo "See https://github.com/sass/dart-sass/releases for available versions"
exit 1
fi
SASS_VERSION=$1
SASS_GZ="dart-sass-$SASS_VERSION-linux-arm64.tar.gz"
SASS_URL="https://github.com/sass/dart-sass/releases/download/$SASS_VERSION/$SASS_GZ"
curl -4 -L -o $SASS_GZ $SASS_URL
tar -xvf $SASS_GZ
sudo mv dart-sass /usr/local
# Add Dart Sass to the PATH
echo 'export PATH=/usr/local/dart-sass:$PATH' >> ~/.profile
# soruce
export PATH=/usr/local/dart-sass:$PATH
# Cleanup
rm $SASS_GZ
# Check Sass
if command -v sass &> /dev/null; then
installed_version=$(sass --version)
if [ "$installed_version" = "$SASS_VERSION" ]; then
echo "Sass $SASS_VERSION installed successfully."
else
echo "Failed to install Sass $SASS_VERSION. Installed version: $installed_version"
exit 1
fi
else
echo "Failed to verify Sass installation. Please check manually."
exit 1
fi