Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2.0 installer script #100

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bundle-env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ unset GEM_CACHE
# necessary.

export PATH=$BIN:$PATH
export SSL_CERT_FILE=$PREFIX/share/cacert.pem

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
Expand Down
20 changes: 20 additions & 0 deletions fastlane_shim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

function gem_cleanup() {
EXCLUDE_SYSTEM_GEMS="true" "${DIR}/bundle/bin/bundle-env" gem cleanup
}

if [ "$1" = "update_fastlane" ]; then
"${DIR}/bundle/bin/bundle-env" gem update --no-document fastlane
gem_cleanup
else
exec "${DIR}/bundle/bin/bundle-env" fastlane "$@"
fi;
9 changes: 7 additions & 2 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ PACKAGED_FASTLANE_VERSION_FILE="$FASTLANE_DIR/PACKAGED_FASTLANE_VERSION.txt"
PACKAGED_RUBY_VERSION_FILE="$FASTLANE_DIR/PACKAGED_RUBY_VERSION.txt"

usage() {
echo "./install [-u] [-p] [-b]"
echo " -u : Uninstall fastlane if it exists in $FASTLANE_DIR"
echo "./install [-p] [-b] [-a]"
echo " -p : Don't update the path automatically"
echo " -b : Installed via homebrew"
echo " -a : autoupdate ruby-build and openssl"
exit 1
}

Expand All @@ -24,6 +24,7 @@ while getopts ":pub" opt; do
case $opt in
p ) SKIP_SETTING_PATH=1;;
b ) INSTALLED_VIA_HOMEBREW=true;;
a ) NO_PROMPS=1;;
* ) usage ;;
esac
done
Expand Down Expand Up @@ -52,6 +53,10 @@ install_or_upgrade_via_homebrew()

prompt_to_install_or_upgrade()
{
if [ "$NO_PROMPS" == "1" ]; then
return
fi

PACKAGE=$1

read -p "The installer needs to install/upgrade $PACKAGE with brew. Is that okay? (y/N) " -n 1 choice
Expand Down