-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d2f85d
commit a1f93cf
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class Heroku < Formula | ||
desc "CLI for Heroku" | ||
homepage "https://www.npmjs.com/package/heroku/" | ||
url "https://registry.npmjs.org/heroku/-/heroku-9.5.1.tgz" | ||
sha256 "1dd66255bdc57f742c091671b2f84f6ee4faca8b9bd967d8528678182cf2a6b5" | ||
license "ISC" | ||
|
||
depends_on "node" | ||
depends_on "terminal-notifier" | ||
|
||
def install | ||
system "npm", "install", *std_npm_args | ||
bin.install_symlink Dir["#{libexec}/bin/*"] | ||
|
||
node_modules = libexec/"lib/node_modules/heroku/node_modules" | ||
# Remove vendored pre-built binary `terminal-notifier` | ||
node_notifier_vendor_dir = node_modules/"node-notifier/vendor" | ||
rm_r(node_notifier_vendor_dir) # remove vendored pre-built binaries | ||
|
||
if OS.mac? | ||
terminal_notifier_dir = node_notifier_vendor_dir/"mac.noindex" | ||
terminal_notifier_dir.mkpath | ||
|
||
# replace vendored `terminal-notifier` with our own | ||
terminal_notifier_app = Formula["terminal-notifier"].opt_prefix/"terminal-notifier.app" | ||
ln_sf terminal_notifier_app.relative_path_from(terminal_notifier_dir), terminal_notifier_dir | ||
end | ||
|
||
# Replace universal binaries with their native slices. | ||
deuniversalize_machos | ||
end | ||
|
||
test do | ||
assert_match "Error: not logged in", shell_output("#{bin}/heroku auth:whoami 2>&1", 100) | ||
end | ||
end |