Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(CAT-2040) pdk spinner inconsistent on windows #1394

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/pdk/cli/exec/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def add_spinner(message, opts = {})

require 'pdk/cli/util/spinner'

@spinner = TTY::Spinner.new("[:spinner] #{message}", opts.merge(PDK::CLI::Util.spinner_opts_for_platform))
@spinner = TTY::Spinner.new("[:spinner] #{message}")
end

def update_environment(additional_env)
Expand Down
12 changes: 0 additions & 12 deletions lib/pdk/cli/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ def ensure_in_module!(opts = {})
end
module_function :ensure_in_module!

def spinner_opts_for_platform
windows_opts = {
success_mark: '*',
error_mark: 'X'
}

return windows_opts if Gem.win_platform?

{}
end
module_function :spinner_opts_for_platform

def prompt_for_yes(question_text, opts = {})
require 'tty/prompt'

Expand Down
4 changes: 2 additions & 2 deletions lib/pdk/validate/external_command_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def prepare_invoke!
if parent_validator.nil? || parent_validator.spinner.nil? || !parent_validator.spinner.is_a?(TTY::Spinner::Multi)
c.add_spinner(spinner_text_for_targets(invokation_targets))
else
spinner = TTY::Spinner.new("[:spinner] #{spinner_text_for_targets(invokation_targets)}", PDK::CLI::Util.spinner_opts_for_platform)
spinner = TTY::Spinner.new("[:spinner] #{spinner_text_for_targets(invokation_targets)}")
parent_validator.spinner.register(spinner)
c.register_spinner(spinner, PDK::CLI::Util.spinner_opts_for_platform)
c.register_spinner(spinner)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/validate/invokable_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def spinner

require 'pdk/cli/util/spinner'

@spinner = TTY::Spinner.new("[:spinner] #{spinner_text}", PDK::CLI::Util.spinner_opts_for_platform)
@spinner = TTY::Spinner.new("[:spinner] #{spinner_text}")
end

# Process any targets that were skipped by the validator and add the events to the validation report
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/validate/validator_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def spinner

require 'pdk/cli/util/spinner'

@spinner = TTY::Spinner::Multi.new("[:spinner] #{spinner_text}", PDK::CLI::Util.spinner_opts_for_platform)
@spinner = TTY::Spinner::Multi.new("[:spinner] #{spinner_text}")

# Register the child spinners
validator_instances.each do |instance|
Expand Down
Loading