Simple backup when macOS

[GitHub link #44]
This commit is contained in:
Aoran Zeng 2024-07-09 10:06:00 +08:00
parent 574df6a5d1
commit e2ed66254b

View File

@ -7,7 +7,7 @@
* Contributors : Peng Gao <gn3po4g@outlook.com> * Contributors : Peng Gao <gn3po4g@outlook.com>
* | * |
* Created on : <2023-08-29> * Created on : <2023-08-29>
* Last modified : <2024-07-08> * Last modified : <2024-07-09>
* *
* chsrc * chsrc
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
@ -709,9 +709,9 @@ chsrc_backup (const char *path)
{ {
char *cmd = NULL; char *cmd = NULL;
if (xy_on_bsd) if (xy_on_bsd || xy_on_macos)
{ {
// 似乎BSD的cp并没有 --backup='t' 选项 /* BSD 和 macOS 的 cp 不支持 --backup 选项 */
cmd = xy_strjoin (5, "cp -f ", path, " ", path, ".bak"); cmd = xy_strjoin (5, "cp -f ", path, " ", path, ".bak");
} }
else if (xy_on_windows) else if (xy_on_windows)