11class OnesignalCli < Formula
2- desc "The OneSignal CLI is a tool to work with OneSignal projects."
3- homepage "https://github.com/OneSignal/cli"
4- url "https://github.com/OneSignal/cli/archive/refs/tags/0.0.4 .tar.gz"
5- sha256 "0ebfc2ce74af73421828bc03e5c7f11367c42903b2123655a7ec2ace004db3d4 "
6- license "MIT"
7- version "0.0.4 "
2+ desc "The OneSignal CLI is a tool to work with OneSignal projects."
3+ homepage "https://github.com/OneSignal/cli"
4+ url "https://github.com/OneSignal/cli/archive/refs/tags/gemspec-test .tar.gz"
5+ sha256 "102cab6438af575932dc9e8c81e5198c3d499754ff4c5f39f1e78da685002c43 "
6+ license "MIT"
7+ version "gemspec-test "
88
9- def install
10- prefix . install 'Gemfile'
11- include . install Dir [ "include/*" ]
12- lib . install Dir [ "lib/*" ]
13- bin . install Dir [ "bin/*" ]
14- end
15-
16- def postinstall
17-
18- end
19- test do
20- version_output = shell_output ( "#{ bin } /onesignal version 2>&1" )
21- assert_match ( "cli Version: #{ version } " , version_output )
9+ depends_on "ruby" if Hardware ::CPU . arm?
10+ uses_from_macos "ruby" , since : :catalina
11+
12+ def install
13+ if MacOS . version >= :mojave && MacOS ::CLT . installed?
14+ ENV [ "SDKROOT" ] = ENV [ "HOMEBREW_SDKROOT" ] = MacOS ::CLT . sdk_path ( MacOS . version )
2215 end
23- end
16+
17+ ENV [ "GEM_HOME" ] = libexec
18+
19+ system "gem" , "build" , "onesignal-cli.gemspec"
20+ system "gem" , "install" , "onesignal-cli-1.0.0.gem"
21+
22+ bin . install libexec /"bin/onesignal"
23+ # onesignal executable is now run from the libexec/bin folder
24+ bin . env_script_all_files ( libexec /"bin" , GEM_HOME : ENV [ "GEM_HOME" ] )
25+ end
26+
27+ test do
28+ version_output = shell_output ( "#{ bin } /onesignal version 2>&1" )
29+ assert_match ( "cli Version: #{ version } " , version_output )
30+ end
31+ end
0 commit comments