Commit 9f46e2b1 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'ImproveMethodToLocateCommand' into 'master'

Use shell builtin `command -v` instead non-standard `which`

See merge request gitlab-org/gitlab!32773
parents 05fa0a8a 601ebdc4
...@@ -36,7 +36,7 @@ start_silent() ...@@ -36,7 +36,7 @@ start_silent()
start_sidekiq() start_sidekiq()
{ {
cmd="exec" cmd="exec"
chpst=$(which chpst) chpst=$(command -v chpst)
if [ -n "$chpst" ]; then if [ -n "$chpst" ]; then
cmd="${cmd} ${chpst} -P" cmd="${cmd} ${chpst} -P"
......
...@@ -43,7 +43,7 @@ restart() ...@@ -43,7 +43,7 @@ restart()
start_sidekiq() start_sidekiq()
{ {
cmd="exec" cmd="exec"
chpst=$(which chpst) chpst=$(command -v chpst)
if [ -n "$chpst" ]; then if [ -n "$chpst" ]; then
cmd="${cmd} ${chpst} -P" cmd="${cmd} ${chpst} -P"
......
...@@ -142,7 +142,7 @@ Starting with GitLab 12.0, Git is required to be compiled with `libpcre2`. ...@@ -142,7 +142,7 @@ Starting with GitLab 12.0, Git is required to be compiled with `libpcre2`.
Find out if that's the case: Find out if that's the case:
```shell ```shell
ldd $(which git) | grep pcre2 ldd $(command -v git) | grep pcre2
``` ```
The output should contain `libpcre2-8.so.0`. The output should contain `libpcre2-8.so.0`.
......
...@@ -111,7 +111,7 @@ module QA ...@@ -111,7 +111,7 @@ module QA
end end
def commit_with_gpg(message) def commit_with_gpg(message)
run(%Q{git config user.signingkey #{@gpg_key_id} && git config gpg.program $(which gpg) && git commit -S -m "#{message}"}).to_s run(%Q{git config user.signingkey #{@gpg_key_id} && git config gpg.program $(command -v gpg) && git commit -S -m "#{message}"}).to_s
end end
def push_changes(branch = 'master') def push_changes(branch = 'master')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment