From 9bb2ecc2ba6449da2e171cf52189099369b9504f Mon Sep 17 00:00:00 2001 From: megh Date: Mon, 23 Oct 2023 02:31:38 -0600 Subject: [PATCH 1/5] Adds fossa v3.8.18 --- Casks/f/fossa.rb | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Casks/f/fossa.rb diff --git a/Casks/f/fossa.rb b/Casks/f/fossa.rb new file mode 100644 index 0000000000..9b12257b85 --- /dev/null +++ b/Casks/f/fossa.rb @@ -0,0 +1,66 @@ +cask "fossa" do + version "3.8.18" + sha256 "8fba90188752cea2c35a764f3b2308adc71058d7984cd761dd447a1c8359444f" + + url "https://github.com/fossas/fossa-cli/releases/download/v#{version}/fossa_#{version}_darwin_amd64.zip", + verified: "github.com/fossas/fossa-cli/" + name "fossa" + desc "Zero-configuration polyglot dependency analysis tool" + homepage "https://fossa.com/" + + # Uses github api to retrieve latest release. + # > brew livecheck --debug fossa + # Ref: https://docs.brew.sh/Brew-Livecheck#githublatest-strategy-block + livecheck do + url :stable + strategy :github_latest do |json, regex| + match = json["tag_name"]&.match(regex) + next if match.blank? + + match[1] + end + end + + auto_updates false + + binary "fossa" + + # Verify that binary can be execuated! + postflight do + # If the cmd does not return exit 0, it will + # not perform installation. + cmd = "#{staged_path}/fossa --version" + raise "Could run command: `#{cmd}`." unless system cmd + end + + caveats do + # fossa-cli requires Rosetta 2 for it to run on Apple Silicon. + requires_rosetta + + <<~EOS + ********************************************************************** + + You can find more information about fossa-cli at: + https://github.com/fossas/fossa-cli/tree/master/docs#user-manual + + To use fossa-cli you will FOSSA API KEY: + >> export FOSSA_API_KEY= + + Learn more on how to generate api key: + https://docs.fossa.com/docs/api-reference + + After which, you can use fossa-cli: + >> cd $MY_PROJECT_DIR # Use your actual project location here. + >> fossa analyze + >> fossa test + + To run fossa analysis without without API key in output only mode: + >> fossa analyze --output + + If you are running into issues, contact support at: + https://support.fossa.com/ + + ********************************************************************** + EOS + end +end From 5decac22d91909ad6bb191a02a8c9f3dfeb607c4 Mon Sep 17 00:00:00 2001 From: Megh Date: Tue, 24 Oct 2023 07:47:21 -0600 Subject: [PATCH 2/5] Fossa - rm livecheck, autoupdate, postflight checks and caveats --- Casks/f/fossa.rb | 49 ------------------------------------------------ 1 file changed, 49 deletions(-) diff --git a/Casks/f/fossa.rb b/Casks/f/fossa.rb index 9b12257b85..7496f63a8a 100644 --- a/Casks/f/fossa.rb +++ b/Casks/f/fossa.rb @@ -8,59 +8,10 @@ cask "fossa" do desc "Zero-configuration polyglot dependency analysis tool" homepage "https://fossa.com/" - # Uses github api to retrieve latest release. - # > brew livecheck --debug fossa - # Ref: https://docs.brew.sh/Brew-Livecheck#githublatest-strategy-block - livecheck do - url :stable - strategy :github_latest do |json, regex| - match = json["tag_name"]&.match(regex) - next if match.blank? - - match[1] - end - end - - auto_updates false - binary "fossa" - # Verify that binary can be execuated! - postflight do - # If the cmd does not return exit 0, it will - # not perform installation. - cmd = "#{staged_path}/fossa --version" - raise "Could run command: `#{cmd}`." unless system cmd - end - caveats do # fossa-cli requires Rosetta 2 for it to run on Apple Silicon. requires_rosetta - - <<~EOS - ********************************************************************** - - You can find more information about fossa-cli at: - https://github.com/fossas/fossa-cli/tree/master/docs#user-manual - - To use fossa-cli you will FOSSA API KEY: - >> export FOSSA_API_KEY= - - Learn more on how to generate api key: - https://docs.fossa.com/docs/api-reference - - After which, you can use fossa-cli: - >> cd $MY_PROJECT_DIR # Use your actual project location here. - >> fossa analyze - >> fossa test - - To run fossa analysis without without API key in output only mode: - >> fossa analyze --output - - If you are running into issues, contact support at: - https://support.fossa.com/ - - ********************************************************************** - EOS end end From 7df36035aed4fe982665d530c7f5d5caa7d97220 Mon Sep 17 00:00:00 2001 From: Megh Date: Tue, 24 Oct 2023 17:32:07 -0700 Subject: [PATCH 3/5] Adds no stanza required line and removes rosetta related comment --- Casks/f/fossa.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Casks/f/fossa.rb b/Casks/f/fossa.rb index 7496f63a8a..8b63083be1 100644 --- a/Casks/f/fossa.rb +++ b/Casks/f/fossa.rb @@ -11,7 +11,8 @@ cask "fossa" do binary "fossa" caveats do - # fossa-cli requires Rosetta 2 for it to run on Apple Silicon. requires_rosetta end + + # No zap stanza required end From a073bfe699c4c013a0a1abd48336c31dd9ff76c9 Mon Sep 17 00:00:00 2001 From: Megh Date: Thu, 26 Oct 2023 10:03:39 -0700 Subject: [PATCH 4/5] fixes: zap comment should come before caveats --- Casks/f/fossa.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Casks/f/fossa.rb b/Casks/f/fossa.rb index 8b63083be1..6e8516a829 100644 --- a/Casks/f/fossa.rb +++ b/Casks/f/fossa.rb @@ -10,9 +10,9 @@ cask "fossa" do binary "fossa" + # No zap stanza required + caveats do requires_rosetta - end - - # No zap stanza required + end end From 26a9682fae81b92cae6a8901a4ad1509ab5c81df Mon Sep 17 00:00:00 2001 From: Megh Date: Thu, 26 Oct 2023 10:10:33 -0700 Subject: [PATCH 5/5] remove tailing space --- Casks/f/fossa.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Casks/f/fossa.rb b/Casks/f/fossa.rb index 6e8516a829..25edc48027 100644 --- a/Casks/f/fossa.rb +++ b/Casks/f/fossa.rb @@ -14,5 +14,5 @@ cask "fossa" do caveats do requires_rosetta - end + end end