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