mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-23 23:28:31 +00:00
Panic when fzf was built without version information
So that the package maintainers would immediately know that the build is incorrect. But is there a way to make build simply fail? Related: https://github.com/junegunn/fzf.vim/issues/1150
This commit is contained in:
parent
0d5f862daf
commit
3304f284a5
17
BUILD.md
17
BUILD.md
@ -17,20 +17,11 @@ make
|
|||||||
# Build fzf binary and copy it to bin directory
|
# Build fzf binary and copy it to bin directory
|
||||||
make install
|
make install
|
||||||
|
|
||||||
# Build 32-bit and 64-bit executables and tarballs in target
|
# Build fzf binaries and archives for all platforms using goreleaser
|
||||||
|
make build
|
||||||
|
|
||||||
|
# Publish GitHub release
|
||||||
make release
|
make release
|
||||||
|
|
||||||
# Make release archives for all supported platforms in target
|
|
||||||
make release-all
|
|
||||||
```
|
|
||||||
|
|
||||||
### Using `go get`
|
|
||||||
|
|
||||||
Alternatively, you can build fzf directly with `go get` command without
|
|
||||||
manually cloning the repository.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
go get -u github.com/junegunn/fzf
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Third-party libraries used
|
Third-party libraries used
|
||||||
|
3
main.go
3
main.go
@ -9,6 +9,9 @@ var version string
|
|||||||
var revision string
|
var revision string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
if len(version) == 0 {
|
||||||
|
panic("Invalid build: version information missing")
|
||||||
|
}
|
||||||
protector.Protect()
|
protector.Protect()
|
||||||
fzf.Run(fzf.ParseOptions(), version, revision)
|
fzf.Run(fzf.ParseOptions(), version, revision)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user