-
Notifications
You must be signed in to change notification settings - Fork 0
/
link-gem.sh
executable file
·29 lines (23 loc) · 1.15 KB
/
link-gem.sh
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
#!/usr/bin/env bash
APPLICATION_PATH="$WORKSPACE/$APPLICATION_DIR"
GEM_PATH="$WORKSPACE/$LOCAL_GEM_DIR"
echo "APPLICATION_PATH = ${APPLICATION_PATH}"
echo "GEM_PATH = ${GEM_PATH}"
cd $APPLICATION_PATH
# TODO: This might be a clumsy, long way to get the name of the gem that we're linking to, but it works.
GEMSPEC_PATH=$GEM_PATH/*.gemspec # /home/runner/work/jbuilder-schema/jbuilder-schema/./*.gemspec
GEMSPEC=$(ls $GEMSPEC_PATH) # /home/runner/work/jbuilder-schema/jbuilder-schema/./jbuilder-schema.gemspec
GEMSPEC_FILE=$(basename -- "$GEMSPEC") # jbuilder-schema.gemspec
GEM_NAME="${GEMSPEC_FILE%.*}" # jbuilder-schema
echo "linking pacakge ${GEM_NAME}"
grep -v "gem \"$GEM_NAME\"" Gemfile > Gemfile.tmp
mv Gemfile.tmp Gemfile
echo "gem \"$GEM_NAME\", path: \"$GEM_PATH\"" >> Gemfile
echo "---------------------------------------------------------"
cat Gemfile
echo "---------------------------------------------------------"
ls -al $GEM_PATH
echo "---------------------------------------------------------"
# TODO: We should be able to add this line back once we merge the un-pinning of jbuilder-schema
bundle install
#bundle lock --conservative --update $GEM_NAME