diff --git a/libexec/dctlenv-list-remote b/libexec/dctlenv-list-remote index bbc6896..b6880eb 100755 --- a/libexec/dctlenv-list-remote +++ b/libexec/dctlenv-list-remote @@ -5,5 +5,5 @@ driftctl_url=https://api.github.com/repos/cloudskiff/driftctl/tags\?page\=1\&per remote_versions="$(curlw -sSf $driftctl_url)" || log_error "Failed to download remote versions from GitHub" -echo $remote_versions | grep -o '"name": "v[^"]*"' | cut -d '"' -f 4 | cut -c 2- | sort +echo $remote_versions | grep -o '"name": "v[^"]*"' | cut -d '"' -f 4 | cut -c 2- | sort -V diff --git a/libexec/dctlenv-version b/libexec/dctlenv-version index a9ddea1..8df0357 100755 --- a/libexec/dctlenv-version +++ b/libexec/dctlenv-version @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -uo pipefail -version="0.1.5" +version="0.1.6" git_revision="" if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q dctlenv; then diff --git a/test/dctlenv-list-remote.bats b/test/dctlenv-list-remote.bats index 31d5409..6017e43 100644 --- a/test/dctlenv-list-remote.bats +++ b/test/dctlenv-list-remote.bats @@ -26,5 +26,8 @@ load "./test_helper" 0.2.3 0.3.0 0.3.1 +0.10.0 +0.11.0 +1.0.0 OUT } diff --git a/test/mocks/list-remote.json b/test/mocks/list-remote.json index e34cc3f..61b320f 100644 --- a/test/mocks/list-remote.json +++ b/test/mocks/list-remote.json @@ -1,4 +1,34 @@ [ + { + "name": "v1.0.0", + "zipball_url": "https://api.github.com/repos/cloudskiff/driftctl/zipball/v1.0.0", + "tarball_url": "https://api.github.com/repos/cloudskiff/driftctl/tarball/v1.0.0", + "commit": { + "sha": "cdea16b5dbca1c6205068d74b092b3e5284cabbd", + "url": "https://api.github.com/repos/cloudskiff/driftctl/commits/cdea16b5dbca1c6205068d74b092b3e5284cabbd" + }, + "node_id": "MDM6UmVmMjk3NjIyOTQ1OnJlZnMvdGFncy92MC4zLjE=" + }, + { + "name": "v0.11.0", + "zipball_url": "https://api.github.com/repos/cloudskiff/driftctl/zipball/v0.11.0", + "tarball_url": "https://api.github.com/repos/cloudskiff/driftctl/tarball/v0.11.0", + "commit": { + "sha": "cdea16b5dbca1c6205068d74b092b3e5284cabbd", + "url": "https://api.github.com/repos/cloudskiff/driftctl/commits/cdea16b5dbca1c6205068d74b092b3e5284cabbd" + }, + "node_id": "MDM6UmVmMjk3NjIyOTQ1OnJlZnMvdGFncy92MC4zLjE=" + }, + { + "name": "v0.10.0", + "zipball_url": "https://api.github.com/repos/cloudskiff/driftctl/zipball/v0.10.0", + "tarball_url": "https://api.github.com/repos/cloudskiff/driftctl/tarball/v0.10.0", + "commit": { + "sha": "cdea16b5dbca1c6205068d74b092b3e5284cabbd", + "url": "https://api.github.com/repos/cloudskiff/driftctl/commits/cdea16b5dbca1c6205068d74b092b3e5284cabbd" + }, + "node_id": "MDM6UmVmMjk3NjIyOTQ1OnJlZnMvdGFncy92MC4zLjE=" + }, { "name": "v0.3.1", "zipball_url": "https://api.github.com/repos/cloudskiff/driftctl/zipball/v0.3.1",