-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flag that allows you to easily search all subdirectories #210
Conversation
Just tested this out. Built the gem and installed it, then I did this: git clone https://github.com/inspec/inspec
cd inspec
bundle install
mkdir some_sub_dir
mv ./habitat some_sub_dir
license_scout --include-sub-directories This is currently failing with this error: nell@nell-ThinkPad-P1:~/inspec$ license_scout --include-sub-directories
WARN: [cli] Could not find /home/nell/inspec/.license_scout.yml -- skipping
INFO: [collector] Found Gemfile and Gemfile.lock files in /home/nell/inspec
INFO: [collector] Found habitat/plan.sh file in /home/nell/inspec/some_sub_dir
INFO: [collector] Found plan.sh file in /home/nell/inspec/some_sub_dir/habitat
INFO: [collector] Collecting licenses for ruby dependencies found in /home/nell/inspec/Gemfile and Gemfile.lock files
INFO: [collector] Collecting licenses for habitat dependencies found in /home/nell/inspec/some_sub_dir/habitat/plan.sh file
Traceback (most recent call last):
11: from /home/nell/.rbenv/versions/2.6.4/bin/license_scout:23:in `<main>'
10: from /home/nell/.rbenv/versions/2.6.4/bin/license_scout:23:in `load'
9: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/bin/license_scout:23:in `<top (required)>'
8: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/lib/license_scout/cli.rb:120:in `run'
7: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/lib/license_scout/collector.rb:35:in `collect'
6: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/lib/license_scout/collector.rb:35:in `each'
5: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/lib/license_scout/collector.rb:35:in `block in collect'
4: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/lib/license_scout/collector.rb:52:in `collect_licenses_from'
3: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/lib/license_scout/dependency_manager/habitat.rb:47:in `dependencies'
2: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/license_scout-2.4.5/lib/license_scout/dependency_manager/habitat.rb:85:in `pkg_deps'
1: from /home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/mixlib-shellout-2.4.4/lib/mixlib/shellout.rb:284:in `error!'
/home/nell/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/mixlib-shellout-2.4.4/lib/mixlib/shellout.rb:297:in `invalid!': Expected process to exit with [0], but received '1' (Mixlib::ShellOut::ShellCommandFailed)
---- Begin output of bash -ec 'export PLAN_CONTEXT="/home/nell/inspec/some_sub_dir/habitat"; source /home/nell/inspec/some_sub_dir/habitat/plan.sh; echo ${pkg_deps[*]}' ----
STDOUT:
STDERR: cat: /home/nell/inspec/some_sub_dir/habitat/../VERSION: No such file or directory
---- End output of bash -ec 'export PLAN_CONTEXT="/home/nell/inspec/some_sub_dir/habitat"; source /home/nell/inspec/some_sub_dir/habitat/plan.sh; echo ${pkg_deps[*]}' ----
Ran bash -ec 'export PLAN_CONTEXT="/home/nell/inspec/some_sub_dir/habitat"; source /home/nell/inspec/some_sub_dir/habitat/plan.sh; echo ${pkg_deps[*]}' returned 1 Digging into it a bit, but is there anything that looks obvious to you from that error output? |
Nevermind! some_sub_dir needed a VERSION file in it. This works! |
2c50772
to
fa872f6
Compare
There may be situations where it is undesirable or unreasonable to individually specify all the directories you want to scan. This change adds the `--include-all-subdirectories` flag which will tell license scout to also look for dependency manager files in nested subdirectories of the configured directory. In practice, you could run the following command in the root of a project repository and feel pretty confident that you have indentified all of the dependencies of all of the software in that project. ``` license_scout --include-sub-directories ``` Signed-off-by: Tom Duffield <[email protected]>
fa872f6
to
520f71b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should clean the readme text up a bit.
Clean up the documentation in the README Co-Authored-By: Ian Maddaus <[email protected]> Signed-off-by: Tom Duffield <[email protected]>
671133e
to
b88f82c
Compare
Description
There may be situations where it is undesirable or unreasonable to individually specify all the directories you want to scan. This change adds the
--include-all-subdirectories
flag which will tell license scout to also look for dependency manager files in nested subdirectories of the configured directory.In practice, you could run the following command in the root of a project repository and feel pretty confident that you have identified all of the dependencies of all of the software in that project.
Related Issue
Addresses #208
Types of changes
Checklist: