This commit is contained in:
2025-12-25 06:04:03 +01:00
parent a784e7f520
commit 44c5c19050
6 changed files with 21 additions and 3 deletions
+6
View File
@@ -17,6 +17,7 @@ const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const util_1 = __importDefault(require("util"));
const child_process_1 = require("child_process");
const grab_dir_names_1 = __importDefault(require("./grab-dir-names"));
const execPromise = util_1.default.promisify(child_process_1.exec);
function sync(_a) {
return __awaiter(this, arguments, void 0, function* ({ options, dirs, dirPath, isFiles, firstRun, }) {
@@ -28,6 +29,8 @@ function sync(_a) {
return dr.path !== dirPath;
return false;
});
const { ignoreFileName } = (0, grab_dir_names_1.default)();
const rsyncIgnoreFile = path_1.default.join(dirPath, ignoreFileName);
const rsyncTrailingSlash = isFiles ? "" : "/";
const allCommandsArr = [];
for (let j = 0; j < dstDirs.length; j++) {
@@ -41,6 +44,9 @@ function sync(_a) {
cmdArray.push(`--include='${incl}'`);
});
}
if (fs_1.default.existsSync(rsyncIgnoreFile)) {
cmdArray.push(`--exclude-from=${rsyncIgnoreFile}`);
}
if ((_c = options === null || options === void 0 ? void 0 : options.exclude) === null || _c === void 0 ? void 0 : _c[0]) {
options.exclude.forEach((excl) => {
cmdArray.push(`--exclude='${excl}'`);