From e80ec0cfbfc59a21dce92099bfee89d65671eed4 Mon Sep 17 00:00:00 2001 From: Akash Manohar J Date: Thu, 14 May 2015 12:21:01 +0530 Subject: [PATCH] Fix sourced usage --- asdf.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/asdf.sh b/asdf.sh index c448f67e..cd2748d8 100644 --- a/asdf.sh +++ b/asdf.sh @@ -1,4 +1,7 @@ -#/usr/bin/env sh +#!/usr/bin/env sh -asdf_dir=$(cd $(dirname $0); echo $(pwd)) -export PATH="$(asdf_dir)/bin:$(asdf_dir)/shims:$PATH" +#TODO check for ${BASH_SOURCE[0]} or use $0 + +current_script_path=${BASH_SOURCE[0]} +asdf_dir=$(cd $(dirname $current_script_path); echo $(pwd)) +export PATH="${asdf_dir}/bin:${asdf_dir}/shims:$PATH"