summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-10-28 10:51:32 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2020-10-28 10:51:32 +0900
commit3304f284a565bc77d8a1009d8e1770e651b95c5c (patch)
treed34af88f7e210e3a2f549764bf4e726e13ba1efe
parent0d5f862daf45336c12c2f540736b3d7ca396c78d (diff)
Panic when fzf was built without version information0.24.0-1
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
-rw-r--r--BUILD.md17
-rw-r--r--main.go3
2 files changed, 7 insertions, 13 deletions
diff --git a/BUILD.md b/BUILD.md
index f6a4f264..dba8b22f 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -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
diff --git a/main.go b/main.go
index d73ab889..bdd733c6 100644
--- a/main.go
+++ b/main.go
@@ -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)
}