mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
62 lines
1.8 KiB
Bash
62 lines
1.8 KiB
Bash
#!/bin/bash
|
|
|
|
BUNDLE_VERSION=0.1
|
|
|
|
# OS Check. Put here because here is where we download the precompiled
|
|
# bundles that are arch specific.
|
|
UNAME=$(uname)
|
|
if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
|
|
echo "Sorry, this OS is not supported."
|
|
exit 1
|
|
fi
|
|
|
|
# Find the script dir, following one level of symlink. Note that symlink
|
|
# can be relative or absolute. Too bad 'readlink -f' is not portable.
|
|
ORIG_DIR=$(pwd)
|
|
cd "$(dirname "$0")"
|
|
if [ -L "$(basename "$0")" ] ; then
|
|
cd "$(dirname $(readlink $(basename "$0") ) )"
|
|
fi
|
|
SCRIPT_DIR=$(pwd -P)/..
|
|
cd "$ORIG_DIR"
|
|
|
|
install_android_bundle () {
|
|
set -e
|
|
trap "echo Failed to install dependency kit." EXIT
|
|
|
|
TARBALL="android_bundle_${UNAME}_${BUNDLE_VERSION}.tar.gz"
|
|
BUNDLE_TMPDIR="$SCRIPT_DIR/android_bundle.xxx"
|
|
|
|
rm -rf "$BUNDLE_TMPDIR"
|
|
mkdir "$BUNDLE_TMPDIR"
|
|
|
|
ANDROID_BUNDLE_URL_ROOT="http://s3.amazonaws.com/android-bundle/"
|
|
|
|
if [ -f "$SCRIPT_DIR/$TARBALL" ] ; then
|
|
echo "Skipping download and installing kit from $SCRIPT_DIR/$TARBALL" >&2
|
|
tar -xzf "$SCRIPT_DIR/$TARBALL" -C "$BUNDLE_TMPDIR"
|
|
else
|
|
curl "$ANDROID_BUNDLE_URL_ROOT$TARBALL" | tar -xzf - -C "$BUNDLE_TMPDIR"
|
|
fi
|
|
|
|
# Delete old dev bundle and rename the new one on top of it.
|
|
rm -rf "$SCRIPT_DIR/android_bundle"
|
|
mv "$BUNDLE_TMPDIR" "$SCRIPT_DIR/android_bundle"
|
|
|
|
echo "Installed dependency kit v${BUNDLE_VERSION} in android_bundle." >&2
|
|
echo >&2
|
|
|
|
trap - EXIT
|
|
set +e;
|
|
}
|
|
|
|
# No matter if we are in the checkout or not, try to install the android_bundle
|
|
if [ ! -d "$SCRIPT_DIR/android_bundle" ] ; then
|
|
install_android_bundle
|
|
elif [ ! -f "$SCRIPT_DIR/android_bundle/.bundle_version.txt" ] ||
|
|
# we might need an android bundle version?
|
|
grep -qvx "$BUNDLE_VERSION" "$SCRIPT_DIR/android_bundle/.bundle_version.txt" ; then
|
|
install_android_bundle
|
|
fi
|
|
|