]> git.saurik.com Git - cycript.git/blobdiff - cycript.in
Add a simple implementation of getcwd for node.js.
[cycript.git] / cycript.in
index 0f6d005c566e57643eab5f40d92d498747386068..077458e4baf19b62c3d8c61f9b26728def589bea 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env bash
-
 # Cycript - The Truly Universal Scripting Language
 # Copyright (C) 2009-2016  Jay Freeman (saurik)
 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # }}}
 
-dir=$(dirname "${BASH_SOURCE[0]}")
-DYLD_LIBRARY_PATH="${dir}"/Cycript.lib exec "${dir}"/Cycript.lib/cycript "$@"
+dir=${0%/*}/Cycript.lib
+if [[ ${dir} != /* ]]; then
+    dir=$(pwd)/${dir}
+fi
+
+if [[ -n $ANDROID_ROOT ]]; then
+    export LD_LIBRARY_PATH="${dir}"
+    export TERMINFO="${dir}"
+    export TERM=linux
+    suffix=-a32
+else
+    export DYLD_LIBRARY_PATH=${dir}
+    suffix=-apl
+fi
+
+exec "${dir}"/cycript"${suffix}" "$@"