Skip to content

Commit

Permalink
Add missing fastlane_shim`
Browse files Browse the repository at this point in the history
  • Loading branch information
Larusso committed Nov 14, 2019
1 parent 5872716 commit 29b7075
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
10 changes: 9 additions & 1 deletion common.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash

FASTLANE_DIR=~/.fastlane/bin
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 )"

FASTLANE_DIR=$DIR/bin
FASTLANE_DIR_RAW="\$HOME/.fastlane/bin" # used to add to the user's profile if necessary
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

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;
10 changes: 5 additions & 5 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ source "$CURRENT_DIR/common.sh"
PACKAGED_FASTLANE_VERSION=2.0.0
PACKAGED_RUBY_VERSION=2.4.5

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"
Expand All @@ -28,6 +25,9 @@ while getopts ":pub" opt; do
esac
done

PACKAGED_FASTLANE_VERSION_FILE="$FASTLANE_DIR/PACKAGED_FASTLANE_VERSION.txt"
PACKAGED_RUBY_VERSION_FILE="$FASTLANE_DIR/PACKAGED_RUBY_VERSION.txt"

install_or_upgrade_via_homebrew()
{
PACKAGE=$1
Expand All @@ -40,12 +40,12 @@ install_or_upgrade_via_homebrew()
echo "$PACKAGE is updated"
else
echo "$PACKAGE is not updated"
prompt_to_install_or_upgrade $PACKAGE
#prompt_to_install_or_upgrade $PACKAGE
brew upgrade $PACKAGE
fi
else
echo "$PACKAGE is not installed."
prompt_to_install_or_upgrade $PACKAGE
#prompt_to_install_or_upgrade $PACKAGE
brew install $PACKAGE
fi
}
Expand Down

0 comments on commit 29b7075

Please sign in to comment.