Skip to content

Commit a5295bd

Browse files
antonioantonio
authored andcommitted
consolidate support functions in a single file
1 parent 2442091 commit a5295bd

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

distribute.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# https://github.com/tito/python-for-android
66
#
77
#------------------------------------------------------------------------------
8+
ifile="$( dirname "${BASH_SOURCE[0]}" )/tools/distribute.functions.sh"
9+
. "$ifile" || { echo "$ifile file not found"; exit 1; }
810

911
# Modules
1012
MODULES=
@@ -43,7 +45,7 @@ if [ "X$VIRTUALENV_NAME" == "X" ]; then
4345
fi
4446

4547
# Paths
46-
ROOT_PATH="$(dirname $($PYTHON -c 'from __future__ import print_function; import os,sys;print(os.path.realpath(sys.argv[1]))' $0))"
48+
ROOT_PATH="$(npath "$0")"
4749
RECIPES_PATH="$ROOT_PATH/recipes"
4850
BUILD_PATH="$ROOT_PATH/build"
4951
LIBS_PATH="$ROOT_PATH/build/libs"

tools/distribute.functions.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function npath
2+
{
3+
python -c 'import os, sys;\
4+
x = os.path.join(*sys.argv[1:]);\
5+
x = os.path.expanduser(x);\
6+
x = os.path.realpath(x);\
7+
x = os.path.normpath(x);\
8+
x = os.path.abspath(x);\
9+
print(x)' "$@"
10+
}
11+

0 commit comments

Comments
 (0)