Skip to content

Commit cea3725

Browse files
committed
fix: correct indentation and fix version parsing in add-common-python-tasks.sh to get latest version
1 parent d420819 commit cea3725

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎scripts/add-common-python-tasks.sh‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ set -e
88
pkg="common-python-tasks"
99
searchOutput=$(poetry search "$pkg")
1010
if [ "$searchOutput" = "No matching packages were found." ]; then
11-
printf 'Package %s not found\n' "$pkg" >&2
12-
exit 1
11+
printf 'Package %s not found\n' "$pkg" >&2
12+
exit 1
1313
fi
14-
ver=$(printf "%s" "$searchOutput" | awk -v p="$pkg" '$1==p{print $2; exit}')
14+
ver=$(printf "%s" "$searchOutput" | awk -v p="$pkg" '$1==p{print $2}' | tail -n1)
1515
if [ -n "$ver" ]; then
16-
poetry add --group dev "$pkg==$ver" || exit 1
16+
poetry add --group dev "$pkg==$ver" || exit 1
1717
else
18-
printf 'Error parsing version for %s\n' "$pkg" >&2
19-
exit 1
18+
printf 'Error parsing version for %s\n' "$pkg" >&2
19+
exit 1
2020
fi
2121

2222
script=$([ -n "$TAGS_TO_INCLUDE" ] && python -c "import sys; tags = sys.argv[1].split(); print('common_python_tasks:tasks(include_tags='+repr(tags)+')')" "$TAGS_TO_INCLUDE" || echo "common_python_tasks:tasks()")

0 commit comments

Comments
 (0)