Skip to content

Commit

Permalink
Merge pull request #540 from soutaro/fix-binstub
Browse files Browse the repository at this point in the history
Fix binstub
  • Loading branch information
soutaro committed Apr 24, 2022
2 parents 8a264b3 + 798e09d commit 4c1beaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/steep/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,16 @@ def process_binstub
#!/usr/bin/env bash
BINSTUB_DIR=$(cd $(dirname $0); pwd)
GEMFILE=${BINSTUB_DIR}/#{gemfile_path}
GEMFILE=$(readlink -f ${BINSTUB_DIR}/#{gemfile_path})
GEMFILE_DIR=$(dirname ${GEMFILE})
STEEP="bundle exec --gemfile=${GEMFILE} steep"
if type "rbenv" > /dev/null 2>&1; then
STEEP="rbenv exec ${STEEP}"
else
if type "rvm" > /dev/null 2>&1; then
STEEP="rvm ${REPO_ROOT} do ${STEEP}"
STEEP="rvm ${GEMFILE_DIR} do ${STEEP}"
fi
fi
Expand Down
5 changes: 3 additions & 2 deletions test/cli_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -557,15 +557,16 @@ def test_binstub_generate
#!/usr/bin/env bash
BINSTUB_DIR=$(cd $(dirname $0); pwd)
GEMFILE=${BINSTUB_DIR}/../Gemfile
GEMFILE=$(readlink -f ${BINSTUB_DIR}/../Gemfile)
GEMFILE_DIR=$(dirname ${GEMFILE})
STEEP="bundle exec --gemfile=${GEMFILE} steep"
if type "rbenv" > /dev/null 2>&1; then
STEEP="rbenv exec ${STEEP}"
else
if type "rvm" > /dev/null 2>&1; then
STEEP="rvm ${REPO_ROOT} do ${STEEP}"
STEEP="rvm ${GEMFILE_DIR} do ${STEEP}"
fi
fi
Expand Down

0 comments on commit 4c1beaa

Please sign in to comment.