diff --git a/Formula/onesignal-cli.rb b/Formula/onesignal-cli.rb new file mode 100644 index 0000000..b5efee0 --- /dev/null +++ b/Formula/onesignal-cli.rb @@ -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 \ No newline at end of file diff --git a/lib/install.sh b/lib/install.sh new file mode 100644 index 0000000..9338e79 --- /dev/null +++ b/lib/install.sh @@ -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` diff --git a/lib/oscli.rb b/lib/oscli.rb index 7781143..88bded4 100644 --- a/lib/oscli.rb +++ b/lib/oscli.rb @@ -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 @@ -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 ]" + puts "usage: onesignal [--version] [--help] [install-sdk --type --entrypoint --lang --appid ]" NetworkHandler.instance.send_track_command("--help") end diff --git a/lib/osnetwork.rb b/lib/osnetwork.rb index 94b9908..4fcdf15 100644 --- a/lib/osnetwork.rb +++ b/lib/osnetwork.rb @@ -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