twcc / TWCC-CLI

This tool allows you to access TWCC through CLI.
https://www.twcc.ai
Apache License 2.0
20 stars 8 forks source link

TWCC_DATA_PATH environment bug #51

Closed Phate334 closed 2 years ago

Phate334 commented 2 years ago

Describe the bug

In twcc.py#L12, if os.path.isdir(os.environ['TWCC_DATA_PATH']) is true, then twccli.py#L21 will throw FileExistsError.

To Reproduce

Just set TWCC_DATA_PATH environment variable, and run twccli config init. But create _TWCC_DATA_DIR_ and log directory manually, everything is good.

Expected behavior

customize twcc_data directory path.

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

https://docs.python.org/3/library/os.html#os.makedirs https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir

AugustChaoTW commented 2 years ago

fixed in v0.6.0