Files
gvm/scripts/templates/binary
T
Ali Abbas c1ec392bdd - Double quoting to avoid globbing
- Remove unecessary $(cat)
- switch * to ./* to avoid entries with dashes to be treated as options
- replace $* with "$@"
- repeating change path serial calls - unecessary if change path is called one (get script)
2014-04-12 15:56:54 +02:00

16 lines
591 B
Bash

#!/usr/bin/env bash
. "$GVM_ROOT/scripts/functions/tools"
echo "$1" | sed -n -e '/_.*_/ p' | $GREP_PATH "_" &> /dev/null
if [ "$?" == "0" ]; then
version=$(echo $1 | sed 's/_\(.*\)_/\1/')
if [[ ! -f $GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/{{package_name}}/$version/bin/{{binary_name}} ]]; then
echo "GVM: Invalid version"
exit 1
fi
shift
"$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/{{package_name}}/$version/bin/{{binary_name}}" "$@"
else
"$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/{{package_name}}/current/bin/{{binary_name}}" "$@"
fi