Skip to content

Commit

Permalink
syncthing: fix HEAD build
Browse files Browse the repository at this point in the history
Closes #65703.

Signed-off-by: chenrui <chenrui333@gmail.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
  • Loading branch information
FiloSottile authored and BrewTestBot committed Nov 26, 2020
1 parent 62d2825 commit 7cd0ab5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Formula/syncthing.rb
Expand Up @@ -4,7 +4,7 @@ class Syncthing < Formula
url "https://github.com/syncthing/syncthing/archive/v1.11.1.tar.gz"
sha256 "741d339dad6335f9a2fb9259a1b57c82896d9363d92a5c9ac2573068bf1859b7"
license "MPL-2.0"
head "https://github.com/syncthing/syncthing.git"
head "https://github.com/syncthing/syncthing.git", branch: "main"

livecheck do
url :head
Expand All @@ -22,7 +22,8 @@ class Syncthing < Formula
depends_on "go" => :build

def install
system "go", "run", "build.go", "--version", "v#{version}", "--no-upgrade", "tar"
build_version = build.head? ? "v0.0.0-#{version}" : "v#{version}"
system "go", "run", "build.go", "--version", build_version, "--no-upgrade", "tar"
bin.install "syncthing"

man1.install Dir["man/*.1"]
Expand Down Expand Up @@ -65,7 +66,8 @@ def plist
end

test do
assert_match "syncthing v#{version} ", shell_output("#{bin}/syncthing --version")
build_version = build.head? ? "v0.0.0-#{version}" : "v#{version}"
assert_match "syncthing #{build_version} ", shell_output("#{bin}/syncthing --version")
system bin/"syncthing", "-generate", "./"
end
end

0 comments on commit 7cd0ab5

Please sign in to comment.