Skip to content

Commit 885ea7f

Browse files
authored
Update app.py
Explain draft file env logic
1 parent a0fa149 commit 885ea7f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
print("Error: The required ACCESS_TOKEN is not set. Please set it in your environment or in your .env file.")
1818
sys.exit(1)
1919

20+
# DRAFTS_FILE specifies the file name or path for saving draft data.
21+
# If DRAFTS_FILE does not exist and contains only a simple filename (without any path separator),
22+
# the application uses the XDG Base Directory Specification to determine the cache directory:
23+
# - It first checks for the XDG_CACHE_HOME environment variable.
24+
# - If not set, it defaults to HOME/.cache.
25+
# Then, a sub-folder named "threads-cli" is created within the cache directory,
26+
# and DRAFTS_FILE is placed inside that sub-folder.
27+
# If DRAFTS_FILE exists as a simple filename, it is used as provided.
28+
# If DRAFTS_FILE already contains a path separator (i.e., it's a complete path),
29+
# the application will use it exactly as given.
30+
2031
# Determine if DRAFTS_FILE not exist and contains a path separator.
2132
if not os.path.exists(DRAFTS_FILE) and os.path.sep not in DRAFTS_FILE:
2233
# Determine the cache directory

0 commit comments

Comments
 (0)