@@ -40,7 +40,9 @@ def get_saved_folder(map_file: Path) -> str:
4040 for suffix in suffixes :
4141 file_name = file_name .removesuffix (suffix )
4242
43- assert not file_name .endswith (".js" ) and not file_name .endswith (".map" ), "Не правильно удалились расширения"
43+ if file_name .endswith (".js" ) or file_name .endswith (".map" ):
44+ raise RuntimeError ("Не правильно удалились расширения" )
45+
4446 return file_name
4547
4648
@@ -70,7 +72,8 @@ def save_decode_result(output_folder: Path, bundle_name: str, decode_result: sou
7072
7173 # Папка в который лежит бандл, относительной данной папки, мы и будет сохранять файлы
7274 relative_folder_in_sm = Path (decode_result .sourceMapStatistic ["sourceMapPath" ]).parent
73- for file_path , file_content in decode_result .files .items ():
75+ for original_file_path , file_content in decode_result .files .items ():
76+ file_path = original_file_path
7477 if check_in_forbidden_symbols (file_path ):
7578 forbidden_paths .append (file_path )
7679 print ("[INFO]" , f"Файл '{ file_path } ' был убран для сохранения" )
@@ -112,15 +115,15 @@ def save_decode_result(output_folder: Path, bundle_name: str, decode_result: sou
112115
113116def get_sources_maps_files (input_path : Path ) -> list [Path ]:
114117 if not input_path .exists ():
115- exit (f"Файл или папки '{ input_path } ' не существует" )
118+ sys . exit (f"Файл или папки '{ input_path } ' не существует" )
116119
117120 if input_path .is_dir ():
118121 return [file for file in input_path .glob ("*.map" ) if file .is_file ()]
119122
120123 if input_path .is_file ():
121124 return [input_path ]
122125
123- exit (f"Невозможно определить тип пути: { input_path } " )
126+ sys . exit (f"Невозможно определить тип пути: { input_path } " )
124127
125128
126129def decoder (input_path : str , output_folder : str ) -> None :
0 commit comments