Skip to content

Commit 54383d5

Browse files
committed
Allow build_bundle lane to be called from CLI
By allowing the `version:` option to be a String We can't pass Hash to lanes when invoking them from the command line using `fastlane build_bundle version:…`; so this change allows to call that lane from the CLI using a `<name>,<code>` String for the `version:` parameter instead
1 parent eecafad commit 54383d5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

fastlane/lanes/build.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
# This lane builds an app bundle
194194
# -----------------------------------------------------------------------------------
195195
# Usage:
196-
# bundle exec fastlane build_bundle app:<wordpress|jetpack> version:<version> flavor:<flavor> buildType:<debug|release> [skip_lint:<true|false>]
196+
# bundle exec fastlane build_bundle app:<wordpress|jetpack> version:<versionName,versionCode> flavor:<flavor> buildType:<debug|release> [skip_lint:<true|false>]
197197
#####################################################################################
198198
desc 'Builds an app bundle'
199199
lane :build_bundle do |options|
@@ -207,6 +207,10 @@
207207
end
208208

209209
prefix = APP_SPECIFIC_VALUES[app.to_sym][:bundle_name_prefix]
210+
if version.is_a?(String) # for when calling from command line
211+
(version_name, version_code) = version.split(',')
212+
version = { 'name' => version_name, 'code' => version_code || '1' }
213+
end
210214
name = "#{prefix}-#{version['name']}.aab"
211215

212216
aab_file = "org.wordpress.android-#{app}-#{options[:flavor]}-#{options[:buildType]}.aab".downcase

0 commit comments

Comments
 (0)