Skip to content

Commit 5004ae2

Browse files
committed
Start REPL on no args in dotty script, fix backticks
1 parent be3e84b commit 5004ae2

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

bin/dotc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# it's based on miniboxing script and paulp's launcher script
44

55
# Try to autodetect real location of the script
6-
DOTTY_ROOT="`readlink \"$0\"`" # relative, symbolic links resolved
6+
DOTTY_ROOT="$(readlink "$0")" # relative, symbolic links resolved
77
if [[ "$DOTTY_ROOT" == "" ]]; then
88
DOTTY_ROOT="$0"
99
fi
10-
DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`"
11-
DOTTY_ROOT="`( cd \"$DOTTY_ROOT\" >& /dev/null && pwd )`/.." # absolute
10+
DOTTY_ROOT="$(dirname "$DOTTY_ROOT")"
11+
DOTTY_ROOT="$( cd "$DOTTY_ROOT" >& /dev/null && pwd )/.." # absolute
1212

1313
# Finds in dotty build file a line containing PATTERN
1414
# returns last "" escaped string in this line

bin/dotty renamed to bin/dottyr

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22

33
# Try to autodetect real location of the script
4-
DOTTY_ROOT="`readlink \"$0\"`" # relative, symbolic links resolved
4+
DOTTY_ROOT="$(readlink "$0")" # relative, symbolic links resolved
55
if [[ "$DOTTY_ROOT" == "" ]]; then
66
DOTTY_ROOT="$0"
77
fi
8-
DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`"
9-
DOTTY_ROOT="`( cd \"$DOTTY_ROOT\" && pwd )`/.." # absolute
8+
DOTTY_ROOT="$(dirname "$DOTTY_ROOT")"
9+
DOTTY_ROOT="$( cd "$DOTTY_ROOT" && pwd )/.." # absolute
1010

1111
# CLASS_PATH is derived from the DOTTY_ROOT
1212
CLASS_PATH="-J-Xbootclasspath/a:.:$DOTTY_ROOT/target/scala-2.11/classes/"
@@ -16,10 +16,8 @@ function runMain {
1616
}
1717

1818
if [ -z "$1" ]; then
19-
echo "usage: $0 MainClass args"
20-
echo ""
21-
echo " missing class argument"
22-
exit 1
19+
echo "Starting dotty REPL..."
20+
eval "$DOTTY_ROOT/bin/dotc -repl"
2321
else
2422
runMain "$@"
2523
fi

0 commit comments

Comments
 (0)