@@ -9,6 +9,15 @@ CONTAINER_TAG=`cat ${ROOT}/bin/.container-tag`
99# Parse command line arguments
1010PRESERVE_CONFIG=0
1111
12+ CONTAINER_SETUP_CMD=()
13+ run () {
14+ if [ " ${CONTAINER_TYPE} " == " docker" -o " ${CONTAINER_TYPE} " == " podman" ]; then
15+ CONTAINER_SETUP_CMD+=( " $* " )
16+ else
17+ ${RUN} " $@ "
18+ fi
19+ }
20+
1221# Only parse arguments if this script is being run directly (not sourced)
1322if [[ " ${BASH_SOURCE[0]} " == " ${0} " ]]; then
1423 for arg in " $@ " ; do
@@ -159,10 +168,8 @@ if [ -f $ROOT/.git ]; then
159168 HOME_OPT=" ${HOME_OPT} --bind ${GIT_PATH} :${GIT_PATH} "
160169fi
161170
162- if [ " ${CONTAINER_TYPE} " == " devcontainer" ]; then
171+ if [ " ${CONTAINER_TYPE} " == " devcontainer" -o " ${CONTAINER_TYPE} " == " docker " -o " ${CONTAINER_TYPE} " == " podman " ]; then
163172 RUN=" "
164- elif [ " ${CONTAINER_TYPE} " == " docker" -o " ${CONTAINER_TYPE} " == " podman" ]; then
165- RUN=" ${CONTAINER_BASE} "
166173elif [ " ${CONTAINER_TYPE} " == " singularity" ]; then
167174 RUN=" singularity run ${HOME_OPT} ${CONTAINER_PATH} "
168175else
@@ -180,16 +187,16 @@ if [ $PRESERVE_CONFIG -eq 0 ] || [ ! -f $ROOT/.bundle/config ]; then
180187 fi
181188 OLDDIR=$PWD
182189 cd $ROOT
183- ${RUN} bundle config set --local path ${ROOT} /.home/.gems
184- ${RUN} bundle config set --local cache_path ${ROOT} /.home/.cache
185- ${RUN} bundle config set --local with development
190+ run bundle config set --local path ${ROOT} /.home/.gems
191+ run bundle config set --local cache_path ${ROOT} /.home/.cache
192+ run bundle config set --local with development
186193 cd $OLDDIR
187194fi
188195
189196if [ ! -d $ROOT /.home/.gems ]; then
190197 OLDDIR=$PWD
191198 cd $ROOT
192- ${RUN} bundle install
199+ run bundle install
193200 cd $OLDDIR
194201fi
195202
203210
204211if [[ ! -z " $DEVELOPMENT " && $DEVELOPMENT -eq 1 ]]; then
205212 if [ ! -d " ${ROOT} /.home/.yard/gem_index" ]; then
206- ${RUN} bundle exec --gemfile ${ROOT} /Gemfile yard config --gem-install-yri
207- ${RUN} bundle exec --gemfile ${ROOT} /Gemfile yard gems
213+ run bundle exec --gemfile ${ROOT} /Gemfile yard config --gem-install-yri
214+ run bundle exec --gemfile ${ROOT} /Gemfile yard gems
208215 touch ${ROOT} /.stamps/dev_gems
209216 fi
210217fi
0 commit comments