diff options
author | Evan Read <eread@gitlab.com> | 2023-02-14 18:23:31 +0300 |
---|---|---|
committer | Sarah German <sgerman@gitlab.com> | 2023-02-14 18:23:31 +0300 |
commit | dff2c0e889d0beebeee2565a90d44cfa8fec548a (patch) | |
tree | 7f26e06946f41236038919ef5bec699185362788 /commands/frontend.rb | |
parent | b01bd7798fb83d66967608e3bd1e910cb5f514ff (diff) |
Fix Lint/UnusedBlockArgument RuboCop violations from frontend.rb
Diffstat (limited to 'commands/frontend.rb')
-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 |