X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/c1d3e52e58e86c49f9d04e06ae8e0ece4b98250c..1e8d80477a3e058a30c477955f1e0c56deb6e956:/cycript.in?ds=sidebyside diff --git a/cycript.in b/cycript.in index b20b733..077458e 100644 --- a/cycript.in +++ b/cycript.in @@ -1,7 +1,5 @@ -#!/usr/bin/env bash - -# Cycript - Optimizing JavaScript Compiler/Runtime -# Copyright (C) 2009-2015 Jay Freeman (saurik) +# Cycript - The Truly Universal Scripting Language +# Copyright (C) 2009-2016 Jay Freeman (saurik) # GNU Affero General Public License, Version 3 {{{ # @@ -19,5 +17,19 @@ # along with this program. If not, see . # }}} -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}" "$@"