DashboardpublishCRAFT_STATE_FILE_PATH existence

CRAFT_STATE_FILE_PATH existence

Category: preference
Confidence: 1.00
ID: 01a0895a-0cb3-7d4f-861c-feb6d6af36db
Project ID: ac098440-8723-4582-9021-39e07a608100
Cross-project: No
Recalled in other projects: 0
Source session: 1INV6ushrYVDng4Os
Created: 2026-09-10 03:26:15
Updated: 2026-09-10 03:26:15

Content

Always guard Craft-state reads with fs.existsSync(CRAFT_STATE_FILE_PATH). Reading directly looks simpler, but missing state is an expected path when publication has not produced a state file; the guard preserves cleanup, including removal of accepted, instead of failing on ENOENT.

Move to: