dart-sass/package/dart-sass.sh
Jen Thakar ccbe35da77 Make function in package script more portable
The script in the standalone package currently fails on OSes like
Ubuntu where /bin/sh does not support functions declared with the
function keyword.

This removes the function keyword from `follow_links`.
2018-01-26 22:03:55 -08:00

22 lines
709 B
Bash

#!/bin/sh
# Copyright 2016 Google Inc. Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
# This script drives the standalone Sass package, which bundles together a Dart
# executable and a snapshot of Sass. It can be created with `pub run grinder
# package`.
follow_links() {
file="$1"
while [ -h "$file" ]; do
# On Mac OS, readlink -f doesn't work.
file="$(readlink "$file")"
done
echo "$file"
}
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
path=`dirname "$(follow_links "$BASH_SOURCE")"`
exec "$path/src/dart" "-Dversion=SASS_VERSION" "$path/src/sass.dart.snapshot" "$@"