utiller 1.0.80 → 1.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1124,6 +1124,26 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1124
1124
|
_iterator7.f();
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
|
+
/** 保守的複製檔案, 如果檔案比較舊, 或是檔案是空的, 就放棄copy行為 */
|
|
1128
|
+
|
|
1129
|
+
}, {
|
|
1130
|
+
key: "copySingleFileConservative",
|
|
1131
|
+
value: function copySingleFileConservative(pathOfDestination, latestFile) {
|
|
1132
|
+
if (this.isEmptyFile(latestFile.absolute)) {
|
|
1133
|
+
this.appendInfo("".concat(latestFile.absolute, " is empty file, ignore copy behavior"));
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
if (!_fs["default"].existsSync(pathOfDestination)) {
|
|
1138
|
+
this.appendInfo("".concat(pathOfDestination, " is not exist, easy to override"));
|
|
1139
|
+
} else if (_fs["default"].existsSync(pathOfDestination) && this.getFileLastModifiedTime(pathOfDestination) < latestFile.lastModifiedTime + 3600) {
|
|
1140
|
+
this.appendInfo("".concat(pathOfDestination, " is the latest, ignore this run"));
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
this.persistByPath(this.getFolderPathOfSpecificPath(pathOfDestination));
|
|
1145
|
+
this.copySingleFile(latestFile.absolute, pathOfDestination, undefined, true);
|
|
1146
|
+
}
|
|
1127
1147
|
}, {
|
|
1128
1148
|
key: "syncDeleteFile",
|
|
1129
1149
|
value: function syncDeleteFile(path) {
|
|
@@ -1559,7 +1579,7 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1559
1579
|
}, {
|
|
1560
1580
|
key: "isEmptyFile",
|
|
1561
1581
|
value: function isEmptyFile(path) {
|
|
1562
|
-
return _lodash["default"].isEqual("", this.getFileContextInRaw(path).trim());
|
|
1582
|
+
return !this.isPathExist(path) || _lodash["default"].isEqual("", this.getFileContextInRaw(path).trim());
|
|
1563
1583
|
}
|
|
1564
1584
|
/** 把檔案弄得好看一點 */
|
|
1565
1585
|
|
package/package.json
CHANGED