2 desc "Command-line tool to help build, run, and test web extensions"
3 homepage "https://github.com/mozilla/web-ext"
4 url "https://registry.npmjs.org/web-ext/-/web-ext-8.4.0.tgz"
5 sha256 "5dcddeaa63ca25a0cbb2ea641d12691af7f92e816f96d4e0f56daa31150f3e1f"
9 sha256 cellar: :any_skip_relocation, arm64_sequoia: "2aa682a7090e03e34a1041b3d9d54ecee870d7406fe7c8a40627fad229003206"
10 sha256 cellar: :any_skip_relocation, arm64_sonoma: "2aa682a7090e03e34a1041b3d9d54ecee870d7406fe7c8a40627fad229003206"
11 sha256 cellar: :any_skip_relocation, arm64_ventura: "2aa682a7090e03e34a1041b3d9d54ecee870d7406fe7c8a40627fad229003206"
12 sha256 cellar: :any_skip_relocation, sonoma: "c997242418dc610143bfe3cbc2fa0c5773ab693485af4aa3706eaf6b4ccbe837"
13 sha256 cellar: :any_skip_relocation, ventura: "c997242418dc610143bfe3cbc2fa0c5773ab693485af4aa3706eaf6b4ccbe837"
14 sha256 cellar: :any_skip_relocation, x86_64_linux: "679ff6e757ae6af8b40f2ea0ffb6e0feeb05145b9b09f260f5ac4c14e3ddd211"
20 depends_on "terminal-notifier"
24 system "npm", "install", *std_npm_args
25 bin.install_symlink Dir["#{libexec}/bin/*"]
27 # Remove vendored pre-built binary `terminal-notifier`
28 node_notifier_vendor_dir = libexec/"lib/node_modules/web-ext/node_modules/node-notifier/vendor"
29 rm_r(node_notifier_vendor_dir) # remove vendored pre-built binaries
32 terminal_notifier_dir = node_notifier_vendor_dir/"mac.noindex"
33 terminal_notifier_dir.mkpath
35 # replace vendored `terminal-notifier` with our own
36 terminal_notifier_app = Formula["terminal-notifier"].opt_prefix/"terminal-notifier.app"
37 ln_sf terminal_notifier_app.relative_path_from(terminal_notifier_dir), terminal_notifier_dir
42 (testpath/"manifest.json").write <<~JSON
44 "manifest_version": 2,
45 "name": "minimal web extension",
49 assert_equal <<~EOF, shell_output("#{bin}/web-ext lint").gsub(/ +$/, "")
58 assert_match version.to_s, shell_output("#{bin}/web-ext --version")