diff options
author | Evan Read <eread@gitlab.com> | 2020-07-31 05:58:01 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2020-08-04 09:49:30 +0300 |
commit | eef35bd1e3516b6084a6994ffdf674e133f4eab4 (patch) | |
tree | 0f1f048f8b677f892c17220f5747f71cf1474d44 /commands/frontend.rb | |
parent | e9dcecc071ebec022b383c2ca6b3b65e430c017e (diff) |
Switch to asdf as preferred dependency manager
Diffstat (limited to 'commands/frontend.rb')
-rw-r--r-- | commands/frontend.rb | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/commands/frontend.rb b/commands/frontend.rb index 9c145dee..24d64d4b 100644 --- a/commands/frontend.rb +++ b/commands/frontend.rb @@ -8,33 +8,19 @@ flag :h, :help, 'show help for this command' do |value, cmd| exit 0 end run do |opts, args, cmd| + puts 'Compiling JavaScript...' + unless system('yarn install --frozen-lockfile') + abort <<~ERROR + Error: failed to run yarn. JavaScript compilation failed. For more information, see: + https://gitlab.com/gitlab-org/gitlab-docs/blob/master/README.md - puts '--------------------------------' - - if check_requirements? - puts 'Compiling JavaScript...' - - system('yarn install --frozen-lockfile') - - system('yarn bundle') + ERROR end -end + unless system('yarn bundle') + abort <<~ERROR + Error: failed to run yarn. JavaScript compilation failed. For more information, see: + https://gitlab.com/gitlab-org/gitlab-docs/blob/master/README.md -def check_requirements? - puts 'Checking requirements...' - - has_requirements = command_exists?('node') && command_exists?('yarn') - - unless has_requirements - puts 'Your system may be missing some requirements.' - puts 'Please refer to the installation instructions for more details:' - puts 'https://gitlab.com/gitlab-org/gitlab-docs/blob/master/README.md' + ERROR end - has_requirements -end - -def command_exists?(command) - exists = system("which #{command} > /dev/null 2>&1") - puts "🚨 #{command} is not installed!" unless exists - exists end |