Skip to content

Commit

Permalink
Add homebrew configuration
Browse files Browse the repository at this point in the history
* Add install script
* Add Formula file
  • Loading branch information
Jeasmine committed Dec 13, 2021
1 parent 8ec7630 commit ed7633d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
19 changes: 19 additions & 0 deletions Formula/onesignal-cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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/v0.0.1.tar.gz"
sha256 "32bf3183804b4c823669eabd426da0f5fb69f7130e8fae2baeba14665420e964"
license "MIT"
version "0.0.1"

def install
lib.install Dir["lib/*"]

bin.install Dir["bin/*"]
end

test do
version_output = shell_output("#{bin}/onesignal version 2>&1")
assert_match("cli Version: #{version}", version_output)
end
end
10 changes: 10 additions & 0 deletions lib/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -e
#
# script/install
#

echo "This is a shell script"

# `gem install bundler` unless `gem list`.lines.grep(/^bundler \(.*\)/)
# `gem install bundler`
# `$PREFIX bin/bundle install`
4 changes: 2 additions & 2 deletions lib/oscli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def execute

class OSCLI < Clamp::Command
option ["--version", "-v"], :flag, "Show version" do
puts OSProject.version
puts OSProject::VERSION
NetworkHandler.instance.send_track_command("--version")
exit(0)
end
Expand All @@ -103,7 +103,7 @@ class OSCLI < Clamp::Command
subcommand "install-sdk", "Add the OneSignal SDK to the project", InstallCommand

def self.helptext
puts "usage: bin/onesignal [--version] [--help] [install-sdk --type <type> <path> <entrypoint> <lang> <appId>]"
puts "usage: onesignal [--version] [--help] [install-sdk --type <type> --entrypoint <entrypoint> --lang <lang> --appid <appId>]"
NetworkHandler.instance.send_track_command("--help")
end

Expand Down
2 changes: 1 addition & 1 deletion lib/osnetwork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def send_track_command(command)
request = Net::HTTP::Post.new(URL)

request['app_id'] = ""
request['OS-Usage-Data'] = get_usage_data(nil, nil, command, nil)
request['OS-Usage-Data'] = get_usage_data(command: command)

response = http.request(request)
end
Expand Down

0 comments on commit ed7633d

Please sign in to comment.