Skip to content

Commit 0859c3a

Browse files
author
liuboping
committed
fix: define data_dir as class method, not local variable
The service block cannot access local variables from install. Define data_dir as a formula method instead.
1 parent 2605215 commit 0859c3a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/go.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,14 @@ jobs:
206206
echo ' end' >> Formula/boltdb.rb
207207
echo ' end' >> Formula/boltdb.rb
208208
echo '' >> Formula/boltdb.rb
209+
echo ' def data_dir' >> Formula/boltdb.rb
210+
echo ' OS.mac? ? "#{ENV["HOME"]}/Library/Application Support/boltdb" : "#{ENV["HOME"]}/.local/share/boltdb"' >> Formula/boltdb.rb
211+
echo ' end' >> Formula/boltdb.rb
212+
echo '' >> Formula/boltdb.rb
209213
echo ' def install' >> Formula/boltdb.rb
210214
echo ' arch = Hardware::CPU.arm? ? "arm64" : "amd64"' >> Formula/boltdb.rb
211215
echo ' os = OS.mac? ? "darwin" : "linux"' >> Formula/boltdb.rb
212216
echo ' bin.install "boltDB-v#{version}-#{os}-#{arch}" => "boltdb"' >> Formula/boltdb.rb
213-
echo ' data_dir = OS.mac? ? "#{ENV["HOME"]}/Library/Application Support/boltdb" : "#{ENV["HOME"]}/.local/share/boltdb"' >> Formula/boltdb.rb
214217
echo " (bin/\"boltdb-run\").write <<~EOS" >> Formula/boltdb.rb
215218
echo ' #!/bin/bash' >> Formula/boltdb.rb
216219
echo ' exec "#{bin}/boltdb" -dir "#{data_dir}" -skip-startup-cleanup' >> Formula/boltdb.rb

0 commit comments

Comments
 (0)