File tree Expand file tree Collapse file tree 3 files changed +22
-15
lines changed Expand file tree Collapse file tree 3 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -194,26 +194,31 @@ languages:
194
194
name : " 得失感悟"
195
195
url : /zh/categories/得失感悟/
196
196
weight : 1
197
- - identifier : advanced_testing
197
+ - identifier : adventure_in_canada
198
198
parent : series
199
- name : " 测试技能进阶 "
200
- url : /zh/categories/测试技能进阶/
199
+ name : " 旅加经历 "
200
+ url : /zh/categories/旅加经历
201
201
weight : 2
202
- - identifier : soft_skill
203
- parent : series
204
- name : " 软件工程师的软技能指北"
205
- url : /zh/categories/软件工程师的软技能指北/
206
- weight : 3
207
202
- identifier : workflow
208
203
parent : series
209
204
name : " 我的工作流"
210
205
url : /zh/categories/工作流/
206
+ weight : 3
207
+ - identifier : advanced_testing
208
+ parent : series
209
+ name : " 测试技能进阶"
210
+ url : /zh/categories/测试技能进阶/
211
211
weight : 4
212
- - identifier : adventure_in_canada
212
+ - identifier : soft_skill
213
213
parent : series
214
- name : " 旅加经历 "
215
- url : /zh/categories/旅加经历
214
+ name : " 软件工程师的软技能指北 "
215
+ url : /zh/categories/软件工程师的软技能指北/
216
216
weight : 5
217
+ - identifier : reinvent
218
+ parent : series
219
+ name : " Reinvent-重新造轮子系列"
220
+ url : /zh/categories/reinvent-重新造轮子系列
221
+ weight : 6
217
222
218
223
markup :
219
224
# https://github.com/adityatelange/hugo-PaperMod/issues/1386
Original file line number Diff line number Diff line change 1
1
+++
2
2
title = " 重新造轮子系列(二):文件备份"
3
3
date = 2025-03-02T11:57:00-08:00
4
- lastmod = 2025-03-02T21:11:37 -08:00
4
+ lastmod = 2025-03-02T21:24:24 -08:00
5
5
tags = [" reinvent" ]
6
6
categories = [" ReInvent: 重新造轮子系列" ]
7
7
draft = false
@@ -95,7 +95,8 @@ export const hashExisting = (rootDir: string): Promise<PathHashPair[]> => {
95
95
96
96
{{< figure src="/ox-hugo/reivent_file_backup_mock_fs.jpg" >}}
97
97
98
- 我们就可以在每个单元测试运行时,任意构造任何想要的文件目录,并且保证文件操作都是在操纵内存对象,而不会直接作用到文件系统,保证单元测试的相互隔离。
98
+ 我们就可以在每个单元测试运行时,任意构造任何想要的文件目录,并且保证文件操作都是在操纵内存对象,
99
+ 而不会直接作用到文件系统,保证单元测试的相互隔离。
99
100
100
101
``` js
101
102
import mock from ' mock-fs'
@@ -204,7 +205,7 @@ drwxr-xr-x@ 11 ramsayleung wheel 352 2 Mar 21:02 .
204
205
205
206
另外,使用哈希函数值作为文件名的确很巧妙,但是对于用户而已,如果不逐个打开文件,根本不知道哪个文件是对应哪个源文件等等。
206
207
207
- 如果想要实现一个更健壮易用的备份文件,可以参考下关于这 [ ` rsync ` 系列的文章] ( https://michael.stapelberg.ch/posts/2022-06-18-rsync-overview/ ) , ` rsync ` 是Linux 上非常流行的增量备份的文件,不仅可以备份本地文件,更可以把文件备份把远程服务器,非常强大。
208
+ 如果想要实现一个更健壮易用的备份文件,可以参考下关于这 [ rsync 系列的文章] ( https://michael.stapelberg.ch/posts/2022-06-18-rsync-overview/ ) , ` rsync ` 是Linux 上非常流行的增量备份的文件,不仅可以备份本地文件,更可以把文件备份把远程服务器,非常强大。
208
209
209
210
210
211
## <span class =" section-num " >5</span > 参考 {#参考}
Original file line number Diff line number Diff line change 1
1
+++
2
2
title = " ReInvent: 重新造轮子系列(序言)"
3
3
date = 2025-02-16T22:10:00-08:00
4
- lastmod = 2025-02-17T11:20:03 -08:00
4
+ lastmod = 2025-03-02T21:34:27 -08:00
5
5
tags = [" reinvent" ]
6
6
categories = [" ReInvent: 重新造轮子系列" ]
7
7
draft = false
@@ -34,3 +34,4 @@ GitHub: <https://github.com/ramsayleung/reinvent>
34
34
原书是用 node + Javascript 编写的,部分代码因API变更而变得不可用,因此本项目也做了对应修改,并将 Javascript 替换成 Typescript, 通过类型系统来降低维护成本。
35
35
36
36
1 . [ 单元测试框架] ({{< relref "reinvent_unit_test" >}})
37
+ 2 . [ 文件备份] ({{< relref "reinvent_file_backup" >}})
You can’t perform that action at this time.
0 commit comments