Skip to content

Commit dedbc75

Browse files
committed
Add yarn to -m option
1 parent 3d86f7a commit dedbc75

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

src/fosslight_dependency/_analyze_dependency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def analyze_dependency(package_manager_name, input_dir, output_dir, pip_activate
3535

3636
if package_manager_name == const.PYPI:
3737
package_manager = Pypi(input_dir, output_dir, pip_activate_cmd, pip_deactivate_cmd)
38-
elif package_manager_name == const.NPM:
38+
elif package_manager_name == const.NPM or package_manager_name == const.YARN:
3939
package_manager = Npm(input_dir, output_dir)
4040
elif package_manager_name == const.MAVEN:
4141
package_manager = Maven(input_dir, output_dir, output_custom_dir)

src/fosslight_dependency/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
-v\t\t\t\t Print the version of the script.
3535
-m <package_manager>\t Enter the package manager.
3636
\t(npm, maven, gradle, pypi, pub, cocoapods, android, swift, carthage,
37-
\t go, nuget, helm, unity, cargo, pnpm)
37+
\t go, nuget, helm, unity, cargo, pnpm, yarn)
3838
-p <input_path>\t\t Enter the path where the script will be run.
3939
-e <exclude_path>\t\t Enter the path where the analysis will not be performed.
4040
-o <output_path>\t\t Output path

src/fosslight_dependency/constant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
UNITY = 'unity'
2626
CARGO = 'cargo'
2727
PNPM = 'pnpm'
28+
YARN = 'yarn'
2829

2930
# Supported package name and manifest file
3031
SUPPORT_PACKAE = {

src/fosslight_dependency/run_dependency_scanner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
207207
autodetect = True
208208
found_package_manager = {}
209209
if package_manager:
210+
scan_item.set_cover_comment(f"Manual detect mode (-m {package_manager})")
211+
if package_manager == const.YARN:
212+
package_manager = const.NPM
210213
autodetect = False
211214
support_packagemanager = list(const.SUPPORT_PACKAE.keys())
212215

@@ -221,7 +224,6 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
221224
manifest_file_name.extend(value)
222225
else:
223226
manifest_file_name.append(value)
224-
scan_item.set_cover_comment(f"Manual detect mode (-m {package_manager})")
225227
else:
226228
manifest_file_name = []
227229

0 commit comments

Comments
 (0)