Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 5522994f authored by gsell's avatar gsell
Browse files

Merge branch '141-implement-better-solution-for-defining-commands' into 'master'

Resolve "implement better solution for defining commands"

Closes #141

See merge request !111
parents 63274d11 a67b3cdf
No related branches found
No related tags found
1 merge request!111Resolve "implement better solution for defining commands"
......@@ -35,6 +35,17 @@ std::die() {
exit $ec
}
std::def_cmds(){
local path="$1"
shift
for cmd in "$@"; do
eval declare -g ${cmd}=$(PATH="${path}" which $cmd 2>/dev/null)
if [[ -z "${!cmd}" ]]; then
std::die 255 "${cmd} not found"
fi
done
}
#
# get answer to yes/no question
#
......
......@@ -13,30 +13,14 @@ declare prefix=$(dirname "${mydir}")
declare -r libdir="${prefix}/lib"
declare -r libexecdir="${prefix}/libexec"
base64=$(PATH=/bin:/usr/bin /usr/bin/which base64)
declare -r base64
mktemp=$(PATH=/bin:/usr/bin /usr/bin/which mktemp)
declare -r mktemp
sort=$(PATH=/bin:/usr/bin /usr/bin/which sort)
declare -r sort
awk=$(PATH=/bin:/usr/bin /usr/bin/which awk)
declare -r awk
rm=$(PATH=/bin:/usr/bin /usr/bin/which rm)
declare -r rm
logger=$(PATH=/bin:/usr/bin /usr/bin/which logger)
declare -r logger
if [[ $(uname -s) == 'Darwin' ]]; then
declare -r getopt="${libexecdir}/getopt"
declare -r find="${libexecdir}/find"
else
getopt=$(PATH=/bin:/usr/bin /usr/bin/which getopt)
declare -r getopt
find=$(PATH=/bin:/usr/bin /usr/bin/which find)
declare -r find
fi
source "${libdir}/libstd.bash"
source "${libdir}/libpmodules.bash"
path="/bin:/usr/bin"
[[ $(uname -s) == 'Darwin' ]] && path+=":${libexecdir}"
std::def_cmds "${path}" \
'awk' 'base64' 'find' 'getopt' 'logger' 'mktemp' \
'rm' 'sort' 'find'
if [[ ${PMODULES_PURETCL} == yes ]]; then
declare -r modulecmd="${libexecdir}/modulecmd.tcl"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment