Skip to content

Commit

Permalink
Panic when fzf was built without version information
Browse files Browse the repository at this point in the history
So that the package maintainers would immediately know that the build is
incorrect. But is there a way to make build simply fail?

Related: junegunn/fzf.vim#1150
  • Loading branch information
junegunn committed Oct 28, 2020
1 parent 0d5f862 commit 3304f28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
17 changes: 4 additions & 13 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,11 @@ make
# Build fzf binary and copy it to bin directory
make install

# Build 32-bit and 64-bit executables and tarballs in target
make release

# Make release archives for all supported platforms in target
make release-all
```

### Using `go get`
# Build fzf binaries and archives for all platforms using goreleaser
make build

Alternatively, you can build fzf directly with `go get` command without
manually cloning the repository.

```sh
go get -u github.com/junegunn/fzf
# Publish GitHub release
make release
```

Third-party libraries used
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ var version string
var revision string

func main() {
if len(version) == 0 {
panic("Invalid build: version information missing")
}
protector.Protect()
fzf.Run(fzf.ParseOptions(), version, revision)
}

0 comments on commit 3304f28

Please sign in to comment.