Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syncthing: fix HEAD build #65703

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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