Skip to content

Commit

Permalink
When extracting archives, look for the 1st file that has prefix in it…
Browse files Browse the repository at this point in the history
…s base name
  • Loading branch information
ashald committed Jun 14, 2019
1 parent f2d7b0c commit 5a82117
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 0.2.0 - 2019-06-13

### Changed

- When extracting archives, look for the 1st file that has prefix `terraform-` in its base name

## 0.1.0 - 2019-06-13

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Please note that FUSE must be available (macOS requires OSXFUSE - https://osxfus

Just download the binary for your platform from the [latest release page](https://github.com/github.com/paraterraform/para/releases/latest) with `wget`:
```bash
wget -O para "https://github.com/paraterraform/para/releases/download/v0.1.0/para_v0.1.0_$(uname -s | tr '[:upper:]' '[:lower:]')-amd64"
wget -O para "https://github.com/paraterraform/para/releases/download/v0.2.0/para_v0.2.0_$(uname -s | tr '[:upper:]' '[:lower:]')-amd64"
chmod +x para
```
or `curl`:
```bash
curl -Lo para "https://github.com/paraterraform/para/releases/download/v0.1.0/para_v0.1.0_$(uname -s | tr '[:upper:]' '[:lower:]')-amd64"
curl -Lo para "https://github.com/paraterraform/para/releases/download/v0.2.0/para_v0.2.0_$(uname -s | tr '[:upper:]' '[:lower:]')-amd64"
chmod +x para
```

Expand Down
3 changes: 3 additions & 0 deletions utils/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func UrlOpen(url string) (io.ReadCloser, error) {
}

err = archiver.Walk(rawData.Name(), func(f archiver.File) error {
if !strings.HasPrefix(strings.ToLower(f.Name()), "terraform-") {
return nil
}
_, err = io.Copy(uncompressedData, f.ReadCloser)
if err != nil {
return err
Expand Down

0 comments on commit 5a82117

Please sign in to comment.