CommunityDragon / CDTB

A library containing everything to extract files from client files.
GNU Lesser General Public License v3.0
119 stars 33 forks source link

fix storage default path #98

Closed TheRaphael0000 closed 6 months ago

TheRaphael0000 commented 6 months ago

When running the command from the readme: python -m cdtb -v download -s cdn patch=

I was getting the following error:

Traceback (most recent call last):
  File "C:\Users\Rapha\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Rapha\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Rapha\AppData\Local\Programs\Python\Python310\Scripts\cdtb.exe\__main__.py", line 7, in <module>
  File "M:\dev\github_external\CDTB\cdtb\__main__.py", line 520, in main
    args.storage = parse_storage_args(parser, args)
  File "M:\dev\github_external\CDTB\cdtb\__main__.py", line 63, in parse_storage_args
    conf = storage_conf_from_path(path)
  File "M:\dev\github_external\CDTB\cdtb\storage.py", line 156, in storage_conf_from_path
    return {'type': 'patcher', 'path': storage_path}
UnboundLocalError: local variable 'storage_path' referenced before assignment

I fixed it by changing the variable used for the default path.

Thanks for your work!

benoitryder commented 6 months ago

Good catch! Thanks for the patch. :)