diff options
author | Sarah German <sgerman@gitlab.com> | 2023-02-14 18:23:32 +0300 |
---|---|---|
committer | Sarah German <sgerman@gitlab.com> | 2023-02-14 18:23:32 +0300 |
commit | c2119be9b1e373b90cfbed44c229fb66fb4295f8 (patch) | |
tree | 0cad949959e80537c94df7e6de11dc95b83d54d1 | |
parent | e3acec00ade643d7b7d734b05b7a3ab69994f267 (diff) | |
parent | dff2c0e889d0beebeee2565a90d44cfa8fec548a (diff) |
Merge branch 'eread/clear-rubocop-violations-from-frontend_rb' into 'main'
Fix Lint/UnusedBlockArgument RuboCop violations from frontend.rb
See merge request https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/3540
Merged-by: Sarah German <sgerman@gitlab.com>
Approved-by: Ash McKenzie <amckenzie@gitlab.com>
Approved-by: Sarah German <sgerman@gitlab.com>
Reviewed-by: Ash McKenzie <amckenzie@gitlab.com>
Co-authored-by: Evan Read <eread@gitlab.com>
-rw-r--r-- | commands/frontend.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/commands/frontend.rb b/commands/frontend.rb index b144b5ca..ec2911c5 100644 --- a/commands/frontend.rb +++ b/commands/frontend.rb @@ -1,16 +1,19 @@ # frozen_string_literal: true +COLOR_CODE_RESET = "\e[0m" +COLOR_CODE_GREEN = "\e[32m" + usage 'frontend [options]' aliases :ds, :stuff summary 'uses nanoc cli to execute frontend related tasks' description 'This command is used by the Nanoc CLI to bundle JavaScript.' -flag :h, :help, 'show help for this command' do |value, cmd| +flag :h, :help, 'show help for this command' do |_value, cmd| puts cmd.help exit 0 end -run do |opts, args, cmd| - puts 'Compiling JavaScript...' +run do |_opts, _args, _cmd| + puts "\n#{COLOR_CODE_GREEN}INFO: Compiling JavaScript...#{COLOR_CODE_RESET}" unless system('yarn install --frozen-lockfile') abort <<~ERROR @@ -28,7 +31,7 @@ run do |opts, args, cmd| ERROR end - puts 'Copying GitLab UI CSS sourcemaps...' + puts "\n#{COLOR_CODE_GREEN}INFO: Copying GitLab UI CSS sourcemaps...#{COLOR_CODE_RESET}" root = File.expand_path('../', __dir__) gl_ui_src = 'node_modules/@gitlab/ui/dist' gl_ui_dest = 'public/frontend/shared' @@ -39,7 +42,7 @@ run do |opts, args, cmd| if ENV['SEARCH_BACKEND'] == "lunr" lunr_src = "node_modules/lunr/lunr.min.js" - puts 'Copying Lunr.js...' + puts "\n#{COLOR_CODE_GREEN}INFO: Copying Lunr.js...#{COLOR_CODE_RESET}" puts "- Copied #{lunr_src}" if File.write('public/assets/javascripts/lunr.min.js', File.read("#{root}/#{lunr_src}")) end end |