From 3290f935120a3afb96ba3c7cd5e2e7af4e1b4a30 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 30 Nov 2017 12:33:46 +0100 Subject: [PATCH] fix cd to python dir in freeze.bash - cd was missing, instead the directory was being printed - readlink doesn't exist on BSD --- repo2docker/buildpacks/python/freeze.bash | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/repo2docker/buildpacks/python/freeze.bash b/repo2docker/buildpacks/python/freeze.bash index e1ebb40d..bb614326 100755 --- a/repo2docker/buildpacks/python/freeze.bash +++ b/repo2docker/buildpacks/python/freeze.bash @@ -5,7 +5,14 @@ set -euo pipefail # Does the same for requirements2.txt to requirements2.frozen.txt... # cd to the directory where the freeze script is located -dirname "$(readlink -f "$0")" +if [[ ! -z "$(which realpath 2>/dev/null)" ]]; then + realpath=realpath +else + realpath="readlink -f" +fi + +cd $(dirname "$($realpath "$0")") + function freeze-requirements { # Freeze a requirements file $2 into a frozen requirements file $3