@@ -112,46 +112,41 @@ jobs:
112112 git clone https://x-access-token:${GH_TOKEN}@github.com/gizmodata/homebrew-tap.git tap
113113 cd tap
114114
115- # Update the formula
116- cat > Formula/gizmosql-ui.rb << 'FORMULA'
117- class GizmosqlUi < Formula
118- desc "Web-based SQL interface for GizmoSQL servers"
119- homepage "https://github.com/gizmodata/gizmosql-ui"
120- version "VERSION_PLACEHOLDER"
121- license "Apache-2.0"
122-
123- on_macos do
124- if Hardware::CPU.arm?
125- url "https://github.com/gizmodata/gizmosql-ui/releases/download/v#{version}/gizmosql-ui-macos-arm64"
126- sha256 "SHA256_PLACEHOLDER"
127-
128- def install
129- bin.install "gizmosql-ui-macos-arm64" => "gizmosql-ui"
130- end
131- end
132- end
133-
134- def caveats
135- <<~EOS
136- GizmoSQL UI starts a local web server and opens your browser.
137-
138- To start GizmoSQL UI :
139- gizmosql-ui
140-
141- The server runs at http://localhost:4821 by default.
142- Set PORT environment variable to use a different port.
143- EOS
144- end
145-
146- test do
147- assert_match "GizmoSQL", shell_output("#{bin}/gizmosql-ui --help 2>&1", 1)
148- end
149- end
150- FORMULA
151-
152- # Replace placeholders with actual values
153- sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" Formula/gizmosql-ui.rb
154- sed -i "s/SHA256_PLACEHOLDER/${SHA256}/g" Formula/gizmosql-ui.rb
115+ # Update the formula using printf to avoid heredoc issues
116+ printf '%s\n' \
117+ 'class GizmosqlUi < Formula' \
118+ ' desc "Web-based SQL interface for GizmoSQL servers"' \
119+ ' homepage "https://github.com/gizmodata/gizmosql-ui"' \
120+ " version \"${VERSION}\"" \
121+ ' license "Apache-2.0"' \
122+ '' \
123+ ' on_macos do' \
124+ ' if Hardware::CPU.arm?' \
125+ " url \"https://github.com/gizmodata/gizmosql-ui/releases/download/v#{version}/gizmosql-ui-macos-arm64\"" \
126+ " sha256 \"${SHA256}\"" \
127+ '' \
128+ ' def install' \
129+ ' bin.install "gizmosql-ui-macos-arm64" => "gizmosql-ui"' \
130+ ' end' \
131+ ' end' \
132+ ' end' \
133+ '' \
134+ ' def caveats' \
135+ ' <<~EOS' \
136+ ' GizmoSQL UI starts a local web server and opens your browser.' \
137+ '' \
138+ ' To start GizmoSQL UI:' \
139+ ' gizmosql-ui' \
140+ '' \
141+ ' The server runs at http://localhost:4821 by default.' \
142+ ' Set PORT environment variable to use a different port.' \
143+ ' EOS' \
144+ ' end' \
145+ '' \
146+ ' test do' \
147+ ' assert_match "GizmoSQL", shell_output("#{bin}/gizmosql-ui --help 2>&1", 1)' \
148+ ' end' \
149+ 'end' > Formula/gizmosql-ui.rb
155150
156151 # Commit and push
157152 git config user.name "github-actions[bot]"
0 commit comments