Skip to content

Commit e011bc7

Browse files
committed
check if the latest version
1 parent 0bfd31c commit e011bc7

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/dart/test.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22
set -e
33
source dev-container-features-test-lib
44

5-
check 'dart' dart --version
5+
# Clean up
6+
rm -rf /var/lib/apt/lists/*
7+
8+
apt_get_update() {
9+
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
10+
echo "Running apt-get update..."
11+
apt-get update -y
12+
fi
13+
}
14+
15+
check_packages() {
16+
if ! dpkg -s "$@" >/dev/null 2>&1; then
17+
apt_get_update
18+
apt-get -y install --no-install-recommends "$@"
19+
fi
20+
}
21+
22+
check_packages git
23+
LATEST_VERSION="$(git ls-remote --tags https://github.com/dart-lang/sdk | grep -oP "[0-9]+\\.[0-9]+\\.[0-9]+" | sort -V | tail -n 1)"
24+
25+
check 'dart' dart --version | grep "${LATEST_VERSION}"
626

727
reportResults

0 commit comments

Comments
 (0)