Commit ab10e8a8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

enable support for use in gear without specname

parent 09b7e9f4
......@@ -65,7 +65,7 @@ fi
LISTRPMARGS=$@
}
parse_cmd_pre "$@"
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
......
......@@ -295,7 +295,7 @@ if is_girar_name $1 ; then
shift
fi
parse_cmd_pre "$@"
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
test -z "$LISTNAMES" && fatal "Error: no such file"
......
......@@ -151,7 +151,7 @@ if is_girar_name $1 ; then
shift
fi
parse_cmd_pre "$@"
parse_cmd_pre_spec "$@"
# quotes brokes option handling
mygetopts $LISTARGS
......
......@@ -67,7 +67,7 @@ if is_girar_name $1 ; then
shift
fi
parse_cmd_pre "$@"
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
[ -n "$LISTNAMES" ] || fatal "Run with exists specs as arg"
......
......@@ -229,7 +229,7 @@ function print_error()
exit 1
}
parse_cmd_pre "$@"
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
test -z "$VERBOSE" || echo "'$LISTNAMES' @ '$LISTRPMARGS'"
......
......@@ -56,7 +56,7 @@ fi
LISTRPMARGS=$@
}
parse_cmd_pre "$@"
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
......
......@@ -129,7 +129,7 @@ else
fi
}
# Отделяет файлы в LISTNAMES
# Отделяет файлы в LISTNAMES (с полными путями)
# Отделяет указание среды в MENV
# Устанавливает LISTARGS в оставшиеся аргументы
# использование:
......@@ -169,6 +169,18 @@ detect_target_env
[ -n "$VERBOSE" ] && echo "LISTNAMES=$LISTNAMES LISTARGS=$LISTARGS" || :
}
parse_cmd_pre_spec()
{
# hack for check spec presence in command line
if echo $@ | grep -q \.spec ; then
parse_cmd_pre "$@"
else
local SPEC=$(get_gear_spec)
[ -f "$SPEC" ] && echo "Using autodetected spec $SPEC..."
parse_cmd_pre_spec $SPEC "$@"
fi
}
check_key()
{
echog "Check access to SSH private key..."
......
......@@ -191,9 +191,12 @@ set_specdir()
# search for gear spec
get_gear_spec()
{
local trySpec
trySpec=$(echo *.spec)
local trySpec=""
# check locally only if in gear repo (useful if spec in ~/.gear)
is_gear && trySpec=$(echo *.spec)
# if not in local dir, check spec in git root dir
[ -f "$trySpec" ] || trySpec=`echo $(get_root_git_dir)/*.spec`
# printout nothing if can't get spec
[ -f "$trySpec" ] || trySpec=""
echo $trySpec
test -f "$trySpec"
......
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