mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-09 04:46:19 +10:00
- 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)
16 lines
591 B
Bash
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
|
|
|