Skip to content

Commit 19e874c

Browse files
authored
Merge pull request #294 from zendesk/keith/MPORT-480_standardize_warnings_output
Ensure warnings raised from ZAS are consistent with internal warnings
2 parents 2b5623c + 08f6c68 commit 19e874c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/zendesk_apps_tools/command.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,12 @@ def validate
102102
valid = errors.none?
103103

104104
if valid
105-
app_package.warnings.each { |w| say w.to_s, :yellow }
105+
app_package.warnings.each { |w| say_status 'warning', w.to_s, :yellow }
106106
# clean when all apps are upgraded
107107
run_deprecation_checks unless options[:'unattended']
108108
say_status 'validate', 'OK'
109109
else
110-
errors.each do |e|
111-
say_status 'validate', e.to_s, :red
112-
end
110+
errors.each { |e| say_status 'validate', e.to_s, :red }
113111
end
114112

115113
@destination_stack.pop if options[:path]
@@ -124,7 +122,10 @@ def package
124122

125123
setup_path(options[:path])
126124

127-
say_status 'warning', 'Please note that the name key of manifest.json is currently only used in development.', :yellow if app_package.manifest.name
125+
if app_package.manifest.name
126+
warning = 'Please note that the name key of manifest.json is currently only used in development.'
127+
say_status 'warning', warning, :yellow
128+
end
128129

129130
archive_path = File.join(tmp_dir, "app-#{Time.now.strftime('%Y%m%d%H%M%S')}.zip")
130131

@@ -162,7 +163,8 @@ def clean
162163
def server
163164
setup_path(options[:path])
164165
if app_package.has_file?('assets/app.js')
165-
say 'Warning: creating assets/app.js causes zat server to behave badly.', :yellow
166+
warning = 'Warning: creating assets/app.js causes zat server to behave badly.'
167+
say_status 'warning', warning, :yellow
166168
end
167169

168170
require 'zendesk_apps_tools/server'

0 commit comments

Comments
 (0)