-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating onesignal-cli.rb to use the gemspec
The url and sha will be updated to a release version once a new release is made with the proper tarball.
- Loading branch information
Showing
1 changed file
with
28 additions
and
20 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 |
---|---|---|
@@ -1,23 +1,31 @@ | ||
class OnesignalCli < Formula | ||
desc "The OneSignal CLI is a tool to work with OneSignal projects." | ||
homepage "https://github.com/OneSignal/cli" | ||
url "https://github.com/OneSignal/cli/archive/refs/tags/0.0.4.tar.gz" | ||
sha256 "0ebfc2ce74af73421828bc03e5c7f11367c42903b2123655a7ec2ace004db3d4" | ||
license "MIT" | ||
version "0.0.4" | ||
desc "The OneSignal CLI is a tool to work with OneSignal projects." | ||
homepage "https://github.com/OneSignal/cli" | ||
url "https://github.com/OneSignal/cli/archive/refs/tags/gemspec-test.tar.gz" | ||
sha256 "102cab6438af575932dc9e8c81e5198c3d499754ff4c5f39f1e78da685002c43" | ||
license "MIT" | ||
version "gemspec-test" | ||
|
||
def install | ||
prefix.install 'Gemfile' | ||
include.install Dir["include/*"] | ||
lib.install Dir["lib/*"] | ||
bin.install Dir["bin/*"] | ||
end | ||
|
||
def postinstall | ||
|
||
end | ||
test do | ||
version_output = shell_output("#{bin}/onesignal version 2>&1") | ||
assert_match("cli Version: #{version}", version_output) | ||
depends_on "ruby" if Hardware::CPU.arm? | ||
uses_from_macos "ruby", since: :catalina | ||
|
||
def install | ||
if MacOS.version >= :mojave && MacOS::CLT.installed? | ||
ENV["SDKROOT"] = ENV["HOMEBREW_SDKROOT"] = MacOS::CLT.sdk_path(MacOS.version) | ||
end | ||
end | ||
|
||
ENV["GEM_HOME"] = libexec | ||
|
||
system "gem", "build", "onesignal-cli.gemspec" | ||
system "gem", "install", "onesignal-cli-1.0.0.gem" | ||
|
||
bin.install libexec/"bin/onesignal" | ||
# onesignal executable is now run from the libexec/bin folder | ||
bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV["GEM_HOME"]) | ||
end | ||
|
||
test do | ||
version_output = shell_output("#{bin}/onesignal version 2>&1") | ||
assert_match("cli Version: #{version}", version_output) | ||
end | ||
end |