Skip to content

Commit

Permalink
Fix the bug of direct/transitive npm packages (#177)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyeong Seok <[email protected]>
  • Loading branch information
dd-jy authored Oct 13, 2023
1 parent a13b2e4 commit c453ab5
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/fosslight_dependency/package_manager/Npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ def start_license_checker(self):
else:
self.append_input_package_list_file(self.input_file_name)

if self.flag_tmp_node_modules:
shutil.rmtree(node_modules, ignore_errors=True)
os.remove(tmp_custom_json)

return ret
Expand Down Expand Up @@ -123,11 +121,7 @@ def parse_transitive_relationship(self):
def parse_direct_dependencies(self):
try:
if os.path.isfile(const.SUPPORT_PACKAE.get(self.package_manager_name)):
if not self.flag_tmp_node_modules:
shutil.move(node_modules, f'tmp_fl_{node_modules}')
self.parse_transitive_relationship()
if not self.flag_tmp_node_modules:
shutil.move(f'tmp_fl_{node_modules}', node_modules)
else:
logger.info('Direct/transitive support is not possible because the package.json file does not exist.')
self.direct_dep = False
Expand Down

0 comments on commit c453ab5

Please sign in to comment.