X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/f95d2598051e347460e028286ff2d33e5825e548..1e8d80477a3e058a30c477955f1e0c56deb6e956:/cycript.in diff --git a/cycript.in b/cycript.in index f3b3a82..077458e 100644 --- a/cycript.in +++ b/cycript.in @@ -1,7 +1,5 @@ -#!/usr/bin/env bash - -# Cycript - Optimizing JavaScript Compiler/Runtime -# Copyright (C) 2009-2014 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}" "$@"