X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/7341eedbaf526ef2f0986b576c656906050e270a..5c9d18fc8afb53b7478f4c7e6ab764c52b465769:/cycript.in diff --git a/cycript.in b/cycript.in index 0f6d005..077458e 100644 --- a/cycript.in +++ b/cycript.in @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # Cycript - The Truly Universal Scripting Language # Copyright (C) 2009-2016 Jay Freeman (saurik) @@ -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}" "$@"