File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/fosslight_dependency/package_manager Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,16 @@ def parse_direct_dependencies(self):
182
182
183
183
if os .path .exists (tmp_pub_deps_file ) and os .path .exists (tmp_no_dev_deps_file ):
184
184
try :
185
- with open (tmp_pub_deps_file , 'r' , encoding = 'utf8' ) as deps_f :
185
+ with open (tmp_pub_deps_file , 'r+' , encoding = 'utf8' ) as deps_f :
186
+ lines = deps_f .readlines ()
187
+ deps_f .seek (0 )
188
+ deps_f .truncate ()
189
+ for num , line in enumerate (lines ):
190
+ if line .startswith ('{' ):
191
+ first_line = num
192
+ break
193
+ deps_f .writelines (lines [first_line :])
194
+ deps_f .seek (0 )
186
195
deps_l = json .load (deps_f )
187
196
self .parse_pub_deps_file (deps_l )
188
197
with open (tmp_no_dev_deps_file , 'r' , encoding = 'utf8' ) as no_dev_f :
You can’t perform that action at this time.
0 commit comments