Commit 4e073ed
authored
feat: use snapshot design (#9)
* docs: remove snapshot command from README and refactor backup system to snapshot-based architecture
- Remove "One-time Snapshot" section from both English and Chinese READMEs
- Rename "Download Binary" to "Via Binary" in installation sections
- Refactor backup system from entry-based to snapshot-based architecture:
- Replace BackupEntry with Snapshot and SnapshotFile interfaces
- Add "create" event type to FileEventType
- Change BackupIndex structure to use snapshots array instead of entries
- Replace
* feat: add defensive null checks for snapshot data structures
- Add files array initialization when loading backup index to ensure all snapshots have files property
- Add null-safe array access with fallback to empty arrays in getAllSnapshots(), getFileHistory(), restoreSnapshot(), cleanupOldSnapshots(), and getBackupStats()
- Add null-safe size access with fallback to 0 in getBackupStats()
- Prevent potential runtime errors when accessing snapshots or files arrays that may be undefined
* feat: auto-load .gitignore patterns and expand default exclude patterns
- Add automatic .gitignore file reading and pattern merging in getDefaultConfig()
- Expand default exclude patterns to cover more system and build artifacts:
- Change .git pattern to **/.*/** for all hidden files/directories
- Add database files (*.db, *.sqlite, *.sqlite3)
- Add lock and process files (*.lock, *.lck, *.pid)
- Add system log and trace files (*.idx, *.etl, *.evtx, *.evt, *.trace, *.out, *.asl)
- Add Windows
* update fix
* update fix
* update fix
* update fix
* update fix
* refactor: simplify restore command to use positional argument instead of flags
- Replace --id and --time flags with single positional argument accepting snapshot ID or timestamp
- Auto-detect input type: snap_* prefix for snapshot ID, numeric for timestamp
- Update help text and examples to show new usage: `shield restore <id>`
- Update interactive mode hints to reflect simplified command syntax
- Improve error message to show expected input formats1 parent 3606cb4 commit 4e073ed
File tree
7 files changed
+522
-625
lines changed- src
7 files changed
+522
-625
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 61 | | |
86 | 62 | | |
87 | 63 | | |
88 | | - | |
| 64 | + | |
89 | 65 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 66 | | |
| 67 | + | |
| 68 | + | |
102 | 69 | | |
103 | 70 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 71 | | |
119 | 72 | | |
120 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 60 | | |
85 | 61 | | |
86 | 62 | | |
87 | | - | |
| 63 | + | |
88 | 64 | | |
89 | 65 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 66 | + | |
| 67 | + | |
101 | 68 | | |
102 | 69 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 70 | | |
118 | 71 | | |
119 | 72 | | |
| |||
133 | 86 | | |
134 | 87 | | |
135 | 88 | | |
136 | | - | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments