Skip to content

Commit

Permalink
Add guards against missing env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed May 14, 2021
1 parent 2adf8c6 commit abfd65d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module Actions
class IosGetAppVersionAction < Action
def self.run(params)
require_relative '../../helper/ios/ios_version_helper.rb'

UI.user_error!('You need to set at least the PUBLIC_CONFIG_FILE env var to the path to the public xcconfig file') unless ENV['PUBLIC_CONFIG_FILE']

Fastlane::Helper::Ios::VersionHelper.get_public_version
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ class IosGetBuildVersionAction < Action
def self.run(params)
require_relative '../../helper/ios/ios_version_helper.rb'

UI.user_error!('You need to set at least the PUBLIC_CONFIG_FILE env var to the path to the public xcconfig file') unless ENV['PUBLIC_CONFIG_FILE']

if params[:internal]
UI.user_error!('You need to set the INTERNAL_CONFIG_FILE env var to the path to the internal xcconfig file') unless ENV['INTERNAL_CONFIG_FILE']
Fastlane::Helper::Ios::VersionHelper.get_internal_version
else
Fastlane::Helper::Ios::VersionHelper.get_build_version
Expand Down

0 comments on commit abfd65d

Please sign in to comment.