File tree Expand file tree Collapse file tree 1 file changed +41
-2
lines changed Expand file tree Collapse file tree 1 file changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,54 @@ else
228228
229229 set -x
230230
231+ tmp_dir=$( mktemp -d)
232+
231233 xcodebuild -exportArchive \
232234 -archivePath " ${archive_path} " \
233- -exportPath " ${output_dir } " \
235+ -exportPath " ${tmp_dir } " \
234236 -exportOptionsPlist " ${export_options_path} "
237+
238+ set +x
239+
240+ # Searching for ipa
241+ exported_ipa_path=" "
242+ IFS=$' \n '
243+ for a_file_path in $( find " ${tmp_dir} " -maxdepth 1 -mindepth 1)
244+ do
245+ filename=$( basename " $a_file_path " )
246+ echo " -> moving file: ${a_file_path} to ${output_dir} "
247+
248+ mv " ${a_file_path} " " ${output_dir} "
249+
250+ regex=" .*.ipa"
251+ if [[ " ${filename} " =~ $regex ]]; then
252+ if [[ -z " ${exported_ipa_path} " ]] ; then
253+ exported_ipa_path=" ${output_dir} /${filename} "
254+ else
255+ echo " (!) More then ipa file found"
256+ fi
257+ fi
258+ done
259+ unset IFS
260+
261+ if [[ -z " ${exported_ipa_path} " ]] ; then
262+ echo " (!) No ipa file found"
263+ exit 1
264+ fi
265+
266+ if [ ! -e " ${exported_ipa_path} " ] ; then
267+ echo " (!) Failed to move ipa to output dir"
268+ exit 1
269+ fi
270+
271+ ipa_path=" ${exported_ipa_path} "
235272fi
236273
237274set +v
238- set +x
239275
276+
277+ #
278+ # Export *.ipa path
240279echo " (i) The IPA is now available at: ${ipa_path} "
241280envman add --key BITRISE_IPA_PATH --value " ${ipa_path} "
242281echo ' (i) The IPA path is now available in the Environment Variable: $BITRISE_IPA_PATH'
You can’t perform that action at this time.
0 commit comments