Commit b8fd729
committed
Refactor cleanupNotebook for clarity and fix keep-ipynb edge case
Restructure cleanupNotebook with early returns that separate three
concerns: non-transient notebooks, keep-ipynb preservation, and
transient deletion.
Previously, when keep-ipynb: true was set but the fileInformationCache
missed on target.source (e.g., path normalization mismatches or
preview re-render invalidation), the else-if branch would still
delete the file. The refactored logic checks keep-ipynb first and
short-circuits before the cache lookup, so the user's explicit
keep-ipynb: true is always honored regardless of cache state.
Cache update remains an internal optimization for later project-level
cleanup — not the authoritative signal for whether to delete.1 parent 5c0e1fb commit b8fd729
1 file changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | | - | |
867 | 866 | | |
868 | | - | |
869 | | - | |
870 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
871 | 879 | | |
872 | 880 | | |
873 | | - | |
874 | | - | |
| 881 | + | |
875 | 882 | | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
876 | 886 | | |
877 | 887 | | |
878 | 888 | | |
| |||
0 commit comments