mirror of https://github.com/sbt/sbt.git
Merge pull request #27 from bartschuller/realpath
Use realpath to locate relative files, add python impl
This commit is contained in:
commit
b84dac7a1d
|
|
@ -49,7 +49,7 @@ object Packaging {
|
||||||
fixedLinuxScriptDir <<= target / "linux-scripts",
|
fixedLinuxScriptDir <<= target / "linux-scripts",
|
||||||
fixedUniversalScriptDir <<= target / "universal-scripts",
|
fixedUniversalScriptDir <<= target / "universal-scripts",
|
||||||
linuxFixedScripts <<= (fixedScriptDir, fixedLinuxScriptDir) map fixScripts("/usr/lib/sbt/sbt-launch.jar", "/usr/share/sbt/sbt-launch-lib.bash"),
|
linuxFixedScripts <<= (fixedScriptDir, fixedLinuxScriptDir) map fixScripts("/usr/lib/sbt/sbt-launch.jar", "/usr/share/sbt/sbt-launch-lib.bash"),
|
||||||
universalFixedScripts <<= (fixedScriptDir, fixedUniversalScriptDir) map fixScripts("\\$(dirname \\$0)/sbt-launch.jar", "\\$(dirname \\$0)/sbt-launch-lib.bash"),
|
universalFixedScripts <<= (fixedScriptDir, fixedUniversalScriptDir) map fixScripts("\\$(dirname \\$(realpath \\$0))/sbt-launch.jar", "\\$(dirname \\$(realpath \\$0))/sbt-launch-lib.bash"),
|
||||||
sbtLaunchJarUrl <<= sbtVersion apply downloadUrlForVersion,
|
sbtLaunchJarUrl <<= sbtVersion apply downloadUrlForVersion,
|
||||||
sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"),
|
sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"),
|
||||||
sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) =>
|
sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) =>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,25 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
realpath () {
|
||||||
|
(
|
||||||
|
TARGET_FILE=$1
|
||||||
|
|
||||||
|
cd $(dirname $TARGET_FILE)
|
||||||
|
TARGET_FILE=$(basename $TARGET_FILE)
|
||||||
|
|
||||||
|
COUNT=0
|
||||||
|
while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ]
|
||||||
|
do
|
||||||
|
TARGET_FILE=$(readlink $TARGET_FILE)
|
||||||
|
cd $(dirname $TARGET_FILE)
|
||||||
|
TARGET_FILE=$(basename $TARGET_FILE)
|
||||||
|
COUNT=$(($COUNT + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
echo $(pwd -P)/$TARGET_FILE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
. @@BASH-LIB-LOCATION@@
|
. @@BASH-LIB-LOCATION@@
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue