Merge pull request #395 from erijo/shellcheck
This commit is contained in:
commit
f11974140e
3 changed files with 9 additions and 9 deletions
|
@ -2,7 +2,7 @@ FROM ubuntu:18.04
|
||||||
MAINTAINER Tim Byrne <sultan@locehilios.com>
|
MAINTAINER Tim Byrne <sultan@locehilios.com>
|
||||||
|
|
||||||
# Shellcheck and esh versions
|
# Shellcheck and esh versions
|
||||||
ARG SC_VER=0.7.1
|
ARG SC_VER=0.8.0
|
||||||
ARG ESH_VER=0.3.1
|
ARG ESH_VER=0.3.1
|
||||||
|
|
||||||
# Install prerequisites and configure UTF-8 locale
|
# Install prerequisites and configure UTF-8 locale
|
||||||
|
|
|
@ -25,7 +25,7 @@ def pytest_addoption(parser):
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
def shellcheck_version():
|
def shellcheck_version():
|
||||||
"""Version of shellcheck supported"""
|
"""Version of shellcheck supported"""
|
||||||
return '0.7.1'
|
return '0.8.0'
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
|
|
14
yadm
14
yadm
|
@ -170,8 +170,8 @@ function score_file() {
|
||||||
tgt="${src%%##*}"
|
tgt="${src%%##*}"
|
||||||
conditions="${src#*##}"
|
conditions="${src#*##}"
|
||||||
|
|
||||||
if [ "${tgt#$YADM_ALT/}" != "${tgt}" ]; then
|
if [ "${tgt#"$YADM_ALT/"}" != "${tgt}" ]; then
|
||||||
tgt="${YADM_BASE}/${tgt#$YADM_ALT/}"
|
tgt="${YADM_BASE}/${tgt#"$YADM_ALT/"}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
score=0
|
score=0
|
||||||
|
@ -552,8 +552,8 @@ function alt() {
|
||||||
if [[ $possible_alt =~ .\#\#. ]]; then
|
if [[ $possible_alt =~ .\#\#. ]]; then
|
||||||
base_alt="${possible_alt%%##*}"
|
base_alt="${possible_alt%%##*}"
|
||||||
yadm_alt="${YADM_BASE}/${base_alt}"
|
yadm_alt="${YADM_BASE}/${base_alt}"
|
||||||
if [ "${yadm_alt#$YADM_ALT/}" != "${yadm_alt}" ]; then
|
if [ "${yadm_alt#"$YADM_ALT/"}" != "${yadm_alt}" ]; then
|
||||||
base_alt="${yadm_alt#$YADM_ALT/}"
|
base_alt="${yadm_alt#"$YADM_ALT/"}"
|
||||||
fi
|
fi
|
||||||
possible_alts+=("$YADM_BASE/${base_alt}")
|
possible_alts+=("$YADM_BASE/${base_alt}")
|
||||||
fi
|
fi
|
||||||
|
@ -1382,7 +1382,7 @@ function upgrade() {
|
||||||
;
|
;
|
||||||
do
|
do
|
||||||
if [ -e "$legacy_path" ]; then
|
if [ -e "$legacy_path" ]; then
|
||||||
new_filename=${legacy_path#$YADM_LEGACY_DIR/}
|
new_filename="${legacy_path#"$YADM_LEGACY_DIR/"}"
|
||||||
new_filename="$YADM_DIR/$new_filename"
|
new_filename="$YADM_DIR/$new_filename"
|
||||||
actions_performed=1
|
actions_performed=1
|
||||||
echo "Moving $legacy_path to $new_filename"
|
echo "Moving $legacy_path to $new_filename"
|
||||||
|
@ -1946,7 +1946,7 @@ function relative_path() {
|
||||||
result=""
|
result=""
|
||||||
|
|
||||||
count=0
|
count=0
|
||||||
while [ "${full#$common_part}" == "${full}" ]; do
|
while [ "${full#"$common_part"}" == "${full}" ]; do
|
||||||
[ "$count" = "500" ] && return # this is a failsafe
|
[ "$count" = "500" ] && return # this is a failsafe
|
||||||
# no match, means that candidate common part is not correct
|
# no match, means that candidate common part is not correct
|
||||||
# go up one level (reduce common part)
|
# go up one level (reduce common part)
|
||||||
|
@ -1967,7 +1967,7 @@ function relative_path() {
|
||||||
|
|
||||||
# since we now have identified the common part,
|
# since we now have identified the common part,
|
||||||
# compute the non-common part
|
# compute the non-common part
|
||||||
forward_part="${full#$common_part}"
|
forward_part="${full#"$common_part"}"
|
||||||
|
|
||||||
# and now stick all parts together
|
# and now stick all parts together
|
||||||
if [[ -n $result ]] && [[ -n $forward_part ]]; then
|
if [[ -n $result ]] && [[ -n $forward_part ]]; then
|
||||||
|
|
Loading…
Reference in a new issue