Open antonioholling opened 1 month ago
Thanks for the bug report! There are no unit tests around the podfile_path
and podfile_lock_path
options, so not terribly surprising that we missed this change.
We can write some unit tests that exercise these options to ensure it doesn't break in the future.
@macblazer any update on this? I too, am facing the same issue:
ERROR -- : Missing Podfile in /Users/nookaraju.maddila/Documents/OxfordGit/App. Please use the --path option if not running from the CocoaPods project directory.
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cyclonedx-cocoapods-1.3.0/lib/cyclonedx/cocoapods/podfile_analyzer.rb:110:in validate_options' /opt/homebrew/lib/ruby/gems/3.2.0/gems/cyclonedx-cocoapods-1.3.0/lib/cyclonedx/cocoapods/podfile_analyzer.rb:44:in
ensure_podfile_and_lock_are_present'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cyclonedx-cocoapods-1.3.0/lib/cyclonedx/cocoapods/cli_runner.rb:135:in analyze' /opt/homebrew/lib/ruby/gems/3.2.0/gems/cyclonedx-cocoapods-1.3.0/lib/cyclonedx/cocoapods/cli_runner.rb:42:in
run'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cyclonedx-cocoapods-1.3.0/exe/cyclonedx-cocoapods:25:in <top (required)>' /opt/homebrew/lib/ruby/gems/3.2.0/bin/cyclonedx-cocoapods:25:in
load'
/opt/homebrew/lib/ruby/gems/3.2.0/bin/cyclonedx-cocoapods:25:in `
Due to the commit ea90242 which tried to fix lint issues, the path joining of the working directory with the
Podfile
andPodfile.lock
does not work as expected.Within
podfile_analyzer.rb
, the methodvalidate_options
does the following:options[:podfile_path] = "#{project_dir}Podfile"
in line 108 andoptions[:podfile_lock_path] = "#{project_dir}Podfile.lock"
in line 114Previously, the paths were joined using
+
, which is a possible operator for joining paths when working withPathname
objects. What the code now does is to simply concatenate the strings, resulting in a wrong directory name, thus finding the Podfile or Podfile.lock becomes impossible.