diff --git a/src/main/resources/com/typesafe/sbt/packager/archetypes/bash-template b/src/main/resources/com/typesafe/sbt/packager/archetypes/bash-template index cb38bebc7..8416bbc44 100644 --- a/src/main/resources/com/typesafe/sbt/packager/archetypes/bash-template +++ b/src/main/resources/com/typesafe/sbt/packager/archetypes/bash-template @@ -21,6 +21,13 @@ realpath () { COUNT=$(($COUNT + 1)) done + if [ "$TARGET_FILE" == "." -o "$TARGET_FILE" == ".." ]; then + cd "$TARGET_FILE" + TARGET_FILEPATH= + else + TARGET_FILEPATH=/$TARGET_FILE + fi + # make sure we grab the actual windows path, instead of cygwin's path. if [[ "x$CHECK_CYGWIN" == "x" ]]; then echo "$(pwd -P)/$TARGET_FILE"