Skip to content

Commit 1d262d6

Browse files
authored
Merge pull request #253 from warrensbox/master
Fix repo - update documentation
2 parents 8a41cc2 + 3072cc2 commit 1d262d6

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

.circleci/config.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111

1212
steps:
1313
- checkout
14-
- run:
15-
command: |
16-
set +e
14+
- run:
15+
command: |
16+
set -e
1717
echo "Building website"
1818
sudo apt-get update
1919
sudo apt-get install python3 python3-pip
@@ -22,13 +22,15 @@ jobs:
2222
mkdocs gh-deploy --force
2323
cd ..
2424
25-
echo "Building application"
25+
echo "Building application"
2626
go get -v -t -d ./...
2727
go vet -tests=false ./...
2828
go test -v ./...
2929
mkdir -p build
3030
go build -v -o build/tfswitch
31-
find ./test-data/* -type d | xargs -n 1 ./build/tfswitch -c
31+
find ./test-data/* -type d -print0 | while read -r -d $'\0' TEST_PATH; do
32+
./build/tfswitch -c "${TEST_PATH}" || exit 1
33+
done
3234
3335
release:
3436
docker:
@@ -38,11 +40,11 @@ jobs:
3840

3941
steps:
4042
- checkout
41-
- run:
43+
- run:
4244
command: |
43-
set +e
45+
set -e
4446
source version
45-
export RELEASE_VERSION;
47+
export RELEASE_VERSION;
4648
RELEASE_VERSION=$RELEASE_VERSION.${CIRCLE_BUILD_NUM}
4749
export RELEASE_VERSION;
4850
echo $RELEASE_VERSION
@@ -54,7 +56,7 @@ jobs:
5456
git tag -a ${RELEASE_VERSION} -m "Release Version"
5557
git push origin ${RELEASE_VERSION}
5658
curl -sL https://git.io/goreleaser | bash
57-
59+
5860
workflows:
5961
version: 2
6062

@@ -70,6 +72,6 @@ workflows:
7072
- build
7173
filters:
7274
branches:
73-
only:
75+
only:
7476
- release
7577

lib/list_versions.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func GetTFList(mirrorURL string, preRelease bool) ([]string, error) {
2727
var semver string
2828
if preRelease == true {
2929
// Getting versions from body; should return match /X.X.X-@/ where X is a number,@ is a word character between a-z or A-Z
30-
semver = `\/(\d+\.\d+\.\d+)(-[a-zA-z]+\d*)?"`
30+
semver = `\/(\d+\.\d+\.\d+)(-[a-zA-z]+\d*)?/?"`
3131
} else if preRelease == false {
3232
// Getting versions from body; should return match /X.X.X/ where X is a number
3333
// without the ending '"' pre-release folders would be tried and break.
@@ -73,7 +73,6 @@ func GetTFLatest(mirrorURL string) (string, error) {
7373

7474
//GetTFLatestImplicit : Get the latest implicit terraform version given the hashicorp url
7575
func GetTFLatestImplicit(mirrorURL string, preRelease bool, version string) (string, error) {
76-
7776
if preRelease == true {
7877
//TODO: use GetTFList() instead of GetTFURLBody
7978
versions, error := GetTFURLBody(mirrorURL)

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func main() {
5656
listAllFlag := getopt.BoolLong("list-all", 'l', "List all versions of terraform - including beta and rc")
5757
latestPre := getopt.StringLong("latest-pre", 'p', defaultLatest, "Latest pre-release implicit version. Ex: tfswitch --latest-pre 0.13 downloads 0.13.0-rc1 (latest)")
5858
showLatestPre := getopt.StringLong("show-latest-pre", 'P', defaultLatest, "Show latest pre-release implicit version. Ex: tfswitch --show-latest-pre 0.13 prints 0.13.0-rc1 (latest)")
59-
latestStable := getopt.StringLong("latest-stable", 's', defaultLatest, "Latest implicit version. Ex: tfswitch --latest-stable 0.13 downloads 0.13.7 (latest)")
59+
latestStable := getopt.StringLong("latest-stable", 's', defaultLatest, "Latest implicit version based on a constraint. Ex: tfswitch --latest-stable 0.13.0 downloads 0.13.7 and 0.13 downloads 0.15.5 (latest)")
6060
showLatestStable := getopt.StringLong("show-latest-stable", 'S', defaultLatest, "Show latest implicit version. Ex: tfswitch --show-latest-stable 0.13 prints 0.13.7 (latest)")
6161
latestFlag := getopt.BoolLong("latest", 'u', "Get latest stable version")
6262
showLatestFlag := getopt.BoolLong("show-latest", 'U', "Show latest stable version")

0 commit comments

Comments
 (0)