Moved downloads to user-owned dir.

Sbt launch jars are now downloaded to ~/.sbt/.lib to ensure that
the location is writeable by the user.   This could still be
a faulty assumption, but we'll try it anyway.
This commit is contained in:
Josh Suereth 2011-12-06 22:52:07 -05:00
parent 57dd8bc0ac
commit 7574d35868
1 changed files with 9 additions and 1 deletions

10
sbt
View File

@ -29,6 +29,10 @@ get_mem_opts () {
echo "-Xms${mem}m -Xmx${mem}m -XX:MaxPermSize=${perm}m -XX:ReservedCodeCacheSize=${codecache}m"
}
is_owned_by_user () {
[[ "$(stat --printf='%U' $1)" == "$(USER)" ]] && { echo "OK" ; return; }
}
die() {
echo "Aborting: $@"
exit 1
@ -52,7 +56,11 @@ declare -r latest_29="2.9.1"
declare -r latest_210="2.10.0-SNAPSHOT"
declare -r script_path=$(get_script_path "$BASH_SOURCE")
declare -r script_dir="$(dirname $script_path)"
if test -z "$HOME"; then
declare -r script_dir="$(dirname $script_path)"
else
declare -r script_dir="$HOME/.sbt"
fi
declare -r script_name="$(basename $script_path)"
declare java_cmd=java