Commit 6f147e8de9fc51866e7706a1c35cae957f4df921
1 parent
60467877
Exists in
master
and in
17 other branches
Patch the PATH for gitlab-shell
Showing
1 changed file
with
16 additions
and
1 deletions
Show diff stats
config/software/gitlab-shell.rb
... | ... | @@ -25,7 +25,22 @@ dependency "rsync" |
25 | 25 | source :git => "https://gitlab.com/gitlab-org/gitlab-shell.git" |
26 | 26 | |
27 | 27 | build do |
28 | - command "sed -i 's|^#!/usr/bin/env ruby|#!#{install_dir}/embedded/bin/ruby|' $(grep -r -l '#!/usr/bin/env ruby' .)" | |
28 | + block do | |
29 | + `grep -r -l '#!/usr/bin/env ruby' #{project_dir}`.split("\n").each do |ruby_script| | |
30 | + File.open(ruby_script, "r+") do |file| | |
31 | + script = file.read | |
32 | + file.rewind | |
33 | + file.truncate(0) | |
34 | + file.print <<-EOH | |
35 | +#!/opt/gitlab/embedded/bin/ruby | |
36 | +# Fix the PATH so that gitlab-shell can find git-upload-pack and friends. | |
37 | +ENV['PATH'] = '/opt/gitlab/bin:/opt/gitlab/embedded/bin:' + ENV['PATH'] | |
38 | + | |
39 | + EOH | |
40 | + file.print script | |
41 | + end | |
42 | + end | |
43 | + end | |
29 | 44 | command "mkdir -p #{install_dir}/embedded/service/gitlab-shell" |
30 | 45 | command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-shell/" |
31 | 46 | end | ... | ... |