forked from Juniper/ansible-junos-stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeremy Schulman
committed
Feb 24, 2014
1 parent
1a195f9
commit bd4c092
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
export ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY:`pwd`/library | ||
#!/bin/bash | ||
# usage: source env-setup | ||
|
||
# When run using source as directed, $0 gets set to bash, so we must use $BASH_SOURCE | ||
if [ -n "$BASH_SOURCE" ] ; then | ||
HACKING_DIR=`dirname $BASH_SOURCE` | ||
elif [ $(basename $0) = "env-setup" ]; then | ||
HACKING_DIR=`dirname $0` | ||
else | ||
HACKING_DIR="$PWD" | ||
fi | ||
|
||
# The below is an alternative to readlink -fn which doesn't exist on OS X | ||
# Source: http://stackoverflow.com/a/1678636 | ||
FULL_PATH=`python -c "import os; print(os.path.realpath('$HACKING_DIR'))"` | ||
PRJ_LIBRARY="$FULL_PATH/library" | ||
|
||
[[ $ANSIBLE_LIBRARY != ${PRJ_LIBRARY}* ]] && export ANSIBLE_LIBRARY=$PRJ_LIBRARY:$ANSIBLE_LIBRARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters