File: bundle-bin-path

package info (click to toggle)
rubygems 3.6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 37,448 kB
  • sloc: ruby: 141,650; sh: 94; makefile: 28
file content (33 lines) | stat: -rwxr-xr-x 636 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

set -euf

if [ -z "${AUTOPKGTEST_TMP:-}" ]; then
  AUTOPKGTEST_TMP=$(mktemp -d)
  cleanup() {
    rm -rf "$AUTOPKGTEST_TMP"
  }
  trap cleanup INT TERM EXIT
fi

check() {
  exp="$1"
  exe="$2"
  echo "${exp} = ${exe}:"
  if [ -x "$exe" ]; then
    echo "OK"
  else
    echo "FAIL: ${exe} is not a valid executable"
    return 1
  fi
}

cd $AUTOPKGTEST_TMP
mkdir test
cd test
echo 'gem "rake"' > Gemfile

rc=0
check 'BUNDLE_BIN_PATH' "$(bundle exec sh -c 'echo $BUNDLE_BIN_PATH')" || rc=$((rc + $?))
check 'Gem.bin_path("bundler", "bundle")' "$(ruby -e 'puts Gem.bin_path("bundler", "bundle")')" || rc=$((rc + $?))
exit "$rc"