From 79bd2ed83570caf1e22f9511e84f96ac62cc5fc0 Mon Sep 17 00:00:00 2001 From: Carlos Palhares Date: Fri, 24 Jan 2025 13:59:15 -0300 Subject: [PATCH] Set gemfile for error --- template-dir/hooks/commit-msg | 7 ++++--- template-dir/hooks/overcommit-hook | 7 ++++--- template-dir/hooks/post-checkout | 7 ++++--- template-dir/hooks/post-commit | 7 ++++--- template-dir/hooks/post-merge | 7 ++++--- template-dir/hooks/post-rewrite | 7 ++++--- template-dir/hooks/pre-commit | 7 ++++--- template-dir/hooks/pre-push | 7 ++++--- template-dir/hooks/pre-rebase | 7 ++++--- template-dir/hooks/prepare-commit-msg | 7 ++++--- 10 files changed, 40 insertions(+), 30 deletions(-) diff --git a/template-dir/hooks/commit-msg b/template-dir/hooks/commit-msg index a665ebff..e329028f 100755 --- a/template-dir/hooks/commit-msg +++ b/template-dir/hooks/commit-msg @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/overcommit-hook b/template-dir/hooks/overcommit-hook index a665ebff..e329028f 100755 --- a/template-dir/hooks/overcommit-hook +++ b/template-dir/hooks/overcommit-hook @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/post-checkout b/template-dir/hooks/post-checkout index a665ebff..e329028f 100755 --- a/template-dir/hooks/post-checkout +++ b/template-dir/hooks/post-checkout @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/post-commit b/template-dir/hooks/post-commit index a665ebff..e329028f 100755 --- a/template-dir/hooks/post-commit +++ b/template-dir/hooks/post-commit @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/post-merge b/template-dir/hooks/post-merge index a665ebff..e329028f 100755 --- a/template-dir/hooks/post-merge +++ b/template-dir/hooks/post-merge @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/post-rewrite b/template-dir/hooks/post-rewrite index a665ebff..e329028f 100755 --- a/template-dir/hooks/post-rewrite +++ b/template-dir/hooks/post-rewrite @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/pre-commit b/template-dir/hooks/pre-commit index a665ebff..e329028f 100755 --- a/template-dir/hooks/pre-commit +++ b/template-dir/hooks/pre-commit @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/pre-push b/template-dir/hooks/pre-push index a665ebff..e329028f 100755 --- a/template-dir/hooks/pre-push +++ b/template-dir/hooks/pre-push @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/pre-rebase b/template-dir/hooks/pre-rebase index a665ebff..e329028f 100755 --- a/template-dir/hooks/pre-rebase +++ b/template-dir/hooks/pre-rebase @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin diff --git a/template-dir/hooks/prepare-commit-msg b/template-dir/hooks/prepare-commit-msg index a665ebff..e329028f 100755 --- a/template-dir/hooks/prepare-commit-msg +++ b/template-dir/hooks/prepare-commit-msg @@ -27,10 +27,11 @@ if hook_type == 'overcommit-hook' end # Check if Overcommit should invoke a Bundler context for loading gems -config = File.read('.overcommit.yml') +config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/ +gemfile = Regexp.last_match(1) -if config =~ /gemfile: "?(.*)"?/ - ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1) +if gemfile + ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' begin