Skip to content

Commit 3e5533d

Browse files
committed
telegraf: fix source-build upgrade, remove postinstall
1 parent 22a45bd commit 3e5533d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Formula/t/telegraf.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ class Telegraf < Formula
2525
def install
2626
ldflags = "-s -w -X github.com/influxdata/telegraf/internal.Version=#{version}"
2727
system "go", "build", *std_go_args(ldflags:), "./cmd/telegraf"
28-
(etc/"telegraf.conf").write Utils.safe_popen_read(bin/"telegraf", "config")
29-
end
3028

31-
def post_install
29+
(buildpath/"telegraf.conf").write Utils.safe_popen_read(bin/"telegraf", "config")
30+
etc.install "telegraf.conf"
3231
# Create directory for additional user configurations
3332
(etc/"telegraf.d").mkpath
3433
end
@@ -44,7 +43,6 @@ def post_install
4443
test do
4544
assert_match version.to_s, shell_output("#{bin}/telegraf --version")
4645
(testpath/"config.toml").write shell_output("#{bin}/telegraf -sample-config")
47-
system bin/"telegraf", "-config", testpath/"config.toml", "-test",
48-
"-input-filter", "cpu:mem"
46+
system bin/"telegraf", "-config", testpath/"config.toml", "-test", "-input-filter", "cpu:mem"
4947
end
5048
end

0 commit comments

Comments
 (0)