Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
params[:repo_url] can be empty string
Browse files Browse the repository at this point in the history
Trim it.
  • Loading branch information
Joshua Liebowitz committed Jun 20, 2018
1 parent c6b1af5 commit a7e7c6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/features/onboarding/onboarding_controller.rb
Expand Up @@ -151,6 +151,7 @@ class OnboardingController < ControllerBase
scopes, required = scope_validation_error
scopes_list_wording = scopes.count > 0 ? scopes.map { |scope| "\"#{scope}\"" }.join(",") : "empty"
scopes_wording = scopes.count > 1 ? "scopes" : "scope"
# rubocop:disable Metrics/LineLength
error_message = "Token should be in \"#{required}\" scope, currently it's in #{scopes_list_wording} #{scopes_wording}."
# rubocop:enable Metrics/LineLength
flash[:error] = "#{error_message} See the image below."
Expand All @@ -175,10 +176,9 @@ class OnboardingController < ControllerBase
#
# 2) Redirect back to `/configuration`
post "#{HOME}/git_repo" do
repo_url = params[:repo_url] || DEFAULT_REPO_URL
repo_url = params[:repo_url]&.strip! || DEFAULT_REPO_URL
Services.dot_keys_variable_service.write_keys_file!(
locals: { :repo_url => repo_url }
)
locals: { repo_url: repo_url }
)
Services.configuration_repository_service.setup_private_configuration_repo
Services.onboarding_service.clone_remote_repository_locally
Expand Down

0 comments on commit a7e7c6c

Please sign in to comment.