lib/deploygate/commands/deploy/build.rb in deploygate-0.0.3 vs lib/deploygate/commands/deploy/build.rb in deploygate-0.0.4

- old
+ new

@@ -15,10 +15,13 @@ root_path = DeployGate::Builds::Ios.project_root_path(work_dir) workspaces = DeployGate::Builds::Ios.find_workspaces(root_path) ios(workspaces, options) elsif DeployGate::Build.android?(work_dir) # TODO: support android build + print_no_target + else + print_no_target end end # @param [Array] workspaces # @param [Hash] options @@ -53,10 +56,12 @@ begin ipa_path = DeployGate::Builds::Ios.build(analyze, target_scheme, codesigning_identity, method) rescue => e # TODO: build error handling + use_xcode_path = `xcode-select -p` + DeployGate::Message::Error.print("Current Xcode used to build: #{use_xcode_path} (via xcode-select)") raise e end Push.upload([ipa_path], options) end @@ -138,9 +143,19 @@ DeployGate::Message::Error.print("Error: Failed to create provisioning profile") raise e end DeployGate::Builds::Ios::Export.select_profile(provisioning_profiles) + end + + def print_no_target + message = <<EOF + +No deploy target found. +Please run on the root directory of iOS project or specify .apk/.ipa file to deploy. + +EOF + DeployGate::Message::Warning.print(message) end end end end end