From 719605c903a416731dbce71b4513b4aba51da804 Mon Sep 17 00:00:00 2001 From: Christopher Hunt Date: Mon, 2 Sep 2013 17:40:32 +1000 Subject: [PATCH] Specifically checks for base names of "." and ".." after symlink processing. This enables relative paths to be passed in that are terminated with such strings e.g. "/users/huntc/.." will correctly evaluate to "/users" --- .../com/typesafe/sbt/packager/archetypes/bash-template | 7 +++++++ 1 file changed, 7 insertions(+) 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"