Skip to content

Commit 6522949

Browse files
authored
Name the standalone executable sass rather than dart-sass (#257)
1 parent 9d3c8cd commit 6522949

File tree

6 files changed

+48
-0
lines changed

6 files changed

+48
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
* Don't crash on `$x % 0`.
1515

16+
* The standalone executable distributed on GitHub is now named `sass` rather
17+
than `dart-sass`. The `dart-sass` executable will remain, with a deprecation
18+
message, until 1.0.0 is released.
19+
1620
### Dart API
1721

1822
* Add a `Logger` class that allows users to control how messages are printed by

package/dart-sass.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ REM This script drives the standalone Sass package, which bundles together a
77
REM Dart executable and a snapshot of Sass. It can be created with `pub run
88
REM grinder package`.
99

10+
echo "WARNING: The dart-sass executable is deprecated, use sass instead."
11+
1012
set SCRIPTPATH=%~dp0
1113
set arguments=%*
1214
"%SCRIPTPATH%\src\dart.exe" "-Dversion=SASS_VERSION" "%SCRIPTPATH%\src\sass.dart.snapshot" %arguments%

package/dart-sass.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ follow_links() {
1616
echo "$file"
1717
}
1818

19+
if [ -t 1 ]; then
20+
echo -e "\e[1;33mWarning\e[0;0m: The \e[1;1mdart-sass\e[0;0m executable is deprecated, use \e[1;1msass\e[0;0m instead."
21+
fi
22+
1923
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
2024
path=`dirname "$(follow_links "$BASH_SOURCE")"`
2125
exec "$path/src/dart" "-Dversion=SASS_VERSION" "$path/src/sass.dart.snapshot" "$@"

package/sass.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
REM Copyright 2016 Google Inc. Use of this source code is governed by an
3+
REM MIT-style license that can be found in the LICENSE file or at
4+
REM https://opensource.org/licenses/MIT.
5+
6+
REM This script drives the standalone Sass package, which bundles together a
7+
REM Dart executable and a snapshot of Sass. It can be created with `pub run
8+
REM grinder package`.
9+
10+
set SCRIPTPATH=%~dp0
11+
set arguments=%*
12+
"%SCRIPTPATH%\src\dart.exe" "-Dversion=SASS_VERSION" "%SCRIPTPATH%\src\sass.dart.snapshot" %arguments%

package/sass.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
# Copyright 2016 Google Inc. Use of this source code is governed by an MIT-style
3+
# license that can be found in the LICENSE file or at
4+
# https://opensource.org/licenses/MIT.
5+
6+
# This script drives the standalone Sass package, which bundles together a Dart
7+
# executable and a snapshot of Sass. It can be created with `pub run grinder
8+
# package`.
9+
10+
follow_links() {
11+
file="$1"
12+
while [ -h "$file" ]; do
13+
# On Mac OS, readlink -f doesn't work.
14+
file="$(readlink "$file")"
15+
done
16+
echo "$file"
17+
}
18+
19+
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
20+
path=`dirname "$(follow_links "$BASH_SOURCE")"`
21+
exec "$path/src/dart" "-Dversion=SASS_VERSION" "$path/src/sass.dart.snapshot" "$@"

tool/grind.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ Future _buildPackage(http.Client client, String os, {bool x64: true}) async {
419419
"dart-sass/dart-sass${os == 'windows' ? '.bat' : ''}",
420420
_readAndReplaceVersion(
421421
"package/dart-sass.${os == 'windows' ? 'bat' : 'sh'}"),
422+
executable: true))
423+
..addFile(_fileFromString(
424+
"dart-sass/sass${os == 'windows' ? '.bat' : ''}",
425+
_readAndReplaceVersion(
426+
"package/sass.${os == 'windows' ? 'bat' : 'sh'}"),
422427
executable: true));
423428

424429
var prefix = 'build/dart-sass-$_version-$os-$architecture';

0 commit comments

Comments
 (0)