Skip to content

Commit

Permalink
Merge pull request #100 from Larusso/fix/2.0-build-and-install-ruby-o…
Browse files Browse the repository at this point in the history
…n-brew-install

Fix 2.0 installer script
  • Loading branch information
Josh Holtz committed Dec 4, 2019
2 parents 5872716 + fcfbc0b commit 5772885
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
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

0 comments on commit 5772885

Please sign in to comment.